[−][src]Trait kul::drop::Algo1DatumRef
Exists so that Datum
s can be moved-out of the reference types that refer
to them, even when there are other weak references.
Required methods
fn try_replace(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
Returns the inner Datum
and replaces it with the given value, if
possible. Otherwise, an error is returned containing the passed-in
value. Some implementations might always succeed.
fn set(this: &mut Self, val: Self::Target)
Mutates the inner Datum
to be the given value. This must never fail.
It is only called after our try_replace
function is called on the same
this
value and succeeded, which allows this set
function to never
fail.
Implementors
impl<TT, ET> Algo1DatumRef for DatumBox<TT, ET>
[src]
This allows using the custom drop algorithm
fn try_replace(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
fn set(this: &mut Self, val: Self::Target)
[src]
impl<TT, ET> Algo1DatumRef for DatumRc<TT, ET>
[src]
This allows using the custom drop algorithm, and it allows the algorithm to
restructure tree nodes that have other weak references to them (which isn't
possible with DerefTryMut::get_mut
alone).
fn try_replace(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
fn set(this: &mut Self, val: Self::Target)
[src]
impl<TT, ET> Algo1DatumRef for DatumArc<TT, ET>
[src]
This allows using the custom drop algorithm, and it allows the algorithm to
restructure tree nodes that have other weak references to them (which isn't
possible with DerefTryMut::get_mut
alone).