pub struct Relevant;
Expand description
Values of this type can’t be automatically dropped.
If struct or enum has field with type Relevant
,
it can’t be automatically dropped either. And so considered relevant too.
User has to deconstruct such values and call Relevant::dispose
.
If relevant field is private it means that user has to move value into some public method.
For example memory::Block
should be returned to the MemoryAllocator
it came from.
User of the engine won’t usually deal with real relevant types. More often user will face wrappers that has backdoor - some technique to dispose internal relevant fields with runtime cost. In debug mode such wrappers can put warnings in log. So that user will know they should be disposed manually.
Panics
Panics when dropped unless:
log
feature is enabled. It this case it emmitslog::error!
.std
feature is enabled and thread is already in panicking state.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Relevant
impl<'de> Deserialize<'de> for Relevant
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Relevant
impl Ord for Relevant
source§impl PartialOrd<Relevant> for Relevant
impl PartialOrd<Relevant> for Relevant
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more