Crate loaned

Source
Expand description

§loaned

loaned provides Loaned<'t, T> and LoanedMut<'t, T> types which allow owning values that have live immutable/mutable borrows, allowing a limited (but very expressive) subset of self-referential structures to be expressed.

§Examples

See examples/.

§Safety

loaned uses unsafe code, the soundness of which has not been rigorously proven, although basic tests have been run successfully through Miri.

Macros§

drop
Drops the value from a Loaned or LoanedMut, statically ensuring that 't is expired.
take
Takes the value from a Loaned or LoanedMut, statically ensuring that 't is expired.

Structs§

Loaned
Loaned<'t, T> connotes ownership of a value T, with the caveat that allocations owned by it are immutably loaned for 't (i.e. something else may hold an &'t reference to such allocations).
LoanedMut
LoanedMut<'t, T> connotes ownership of a value T, with the caveat that allocations owned by it are mutably loaned for 't (i.e. something else may hold an &'t mut reference to such allocations).

Traits§

Loanable
The trait for types that can be used with Loaned::loan and LoanedMut::loan.
Place
Types that can be written into with Loaned::place and LoanedMut::place.
Placeable
Abstracts Loaned::place and LoanedMut::place for take! and drop!.