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
orLoanedMut
, statically ensuring that't
is expired. - take
- Takes the value from a
Loaned
orLoanedMut
, statically ensuring that't
is 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&'t
reference 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 mut
reference to such allocations).
Traits§
- Loanable
- The trait for types that can be used with
Loaned::loan
andLoanedMut::loan
. - Place
- Types that can be written into with
Loaned::place
andLoanedMut::place
. - Placeable
- Abstracts
Loaned::place
andLoanedMut::place
fortake!
anddrop!
.