Trait mica::SelfFromRawValue
source · [−]pub trait SelfFromRawValue {
type Guard;
unsafe fn self_from_raw_value(
value: &RawValue
) -> Result<(&Self, Self::Guard), Error>;
}
Expand description
Implemented by all types that can be a &self
parameter in an instance function.
This should never be implemented manually unless you know what you’re doing.
Required Associated Types
Required Methods
sourceunsafe fn self_from_raw_value(
value: &RawValue
) -> Result<(&Self, Self::Guard), Error>
unsafe fn self_from_raw_value(
value: &RawValue
) -> Result<(&Self, Self::Guard), Error>
Returns a shared reference to Self
without checking that the value is of the correct
type.
Safety
This assumes the value is of the correct type. Calling this with a value whose type is not
Self
results in undefined behavior.
Because GATs aren’t stable yet, Self::Guard
can keep a raw pointer to the value
and as such must not outlive the value.
Implementations on Foreign Types
sourceimpl SelfFromRawValue for ()
impl SelfFromRawValue for ()
()
used as Self
means that the method receiver is nil
.