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
LoanedorLoanedMut, statically ensuring that'tis expired. - take
- Takes the value from a
LoanedorLoanedMut, statically ensuring that'tis expired.
Structs§
- Loaned
Loaned<'t, T>connotes ownership of a valueT, with the caveat that allocations owned by it are immutably loaned for't(i.e. something else may hold an&'treference to such allocations).- Loaned
Mut LoanedMut<'t, T>connotes ownership of a valueT, with the caveat that allocations owned by it are mutably loaned for't(i.e. something else may hold an&'t mutreference to such allocations).
Traits§
- Loanable
- The trait for types that can be used with
Loaned::loanandLoanedMut::loan. - Place
- Types that can be written into with
Loaned::placeandLoanedMut::place. - Placeable
- Abstracts
Loaned::placeandLoanedMut::placefortake!anddrop!.