#cow #borrow #convert #into-static #to-borrowed

no-std lifetime

Traits and derive macros to change the lifetime of a type, allowing efficient reuse of your stucts or enums with any lifetime requirement

3 releases

0.1.0 Aug 21, 2021
0.1.0-beta1 Aug 7, 2021

#510 in Rust patterns


Used in bos

MIT/Apache

11KB
260 lines

lifetime

This crate provides traits and derive macros to change the lifetime of a type, allowing efficient reuse of your stucts or enums with any lifetime requirement.

Have a look at the documentation for more information.

Install

[dependencies]
lifetime = { version = "x.y", features = ["macros"] }

Safety

This crate uses #![forbid(unsafe_code)]. We want to keep this crate 100% safe and its dependencies to a minimum. Currently this crate has no dependencies.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

This crate provides traits and derive macros to change the lifetime of a type, allowing efficient reuse of your stucts or enums with any lifetime requirement.

macros feature

This crate's macros are not enabled by default. Use the following in your Cargo.toml, replacing x.y with the version you want, to enable macros.

[dependencies]
lifetime = { version = "x.y", features = ["macros"] }

no_std

Use the following in your Cargo.toml, replacing x.y with the version you want, to disable the default std and alloc features.

[dependencies]
lifetime = { version = "x.y", default-features = false }

Dependencies

~115KB