Crates.io | hv-elastic |
lib.rs | hv-elastic |
version | 0.4.1 |
source | src |
created_at | 2021-11-12 21:44:29.488119 |
updated_at | 2021-11-23 22:45:30.041057 |
description | Safe and almost-safe abstractions for lengthening lifetimes and `'static` "loaning" of non-`'static` types |
homepage | |
repository | https://github.com/sdleffler/hv-dev |
max_upload_size | |
id | 481138 |
size | 51,335 |
Ever needed to access an &'a T
from a closure which has to be 'static
?
Know that you could "loan" that &'a T
for just the times that that closre will run?
If so, then the Elastic
type is for you! Please use responsibly. no-std
compatible. Requires
nightly for features generic_associated_types
and allocator_api
. Do not use during a new moon.
During a blood moon or solar eclipse, refrigerate any machines which contain the source code for
this crate and keep them under lock and key.
'static
code, with a non-'static
guard to
ensure the references do not live past their lifetime.Elastic
acts as a shared reference with refcell-like internals, providing easy interior
mutability.Stretched
trait for more info. There are very strict requirements on implementing Stretched
. If you
blindly implement Stretched
in a way which violates these requirements, you are going to be in
instant undefined-behavior-land.Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.