pub unsafe trait IoTypeMut {
type Target: IoType;
// Required method
fn io_type_mut(&mut self) -> &mut Self::Target;
}Expand description
Exclusive access to an IoType value.
It is implemented for:
- every
IoType - views that constructors of containers return over exclusive memory, like
MaybeData::from_mut()andVariableElements::from_uninit()
This allows generic code to accept both.
§Safety
Generic code relies on Self::io_type_mut() giving access to a single value owned by Self:
every call returns a reference to the same value without changing it or anything else, and the
value is not accessible other than through Self. Generic code may also move the value out of
Self through that reference and forget Self right after, so the value must stay valid
without Self.
Required Associated Types§
Required Methods§
Sourcefn io_type_mut(&mut self) -> &mut Self::Target
fn io_type_mut(&mut self) -> &mut Self::Target
Exclusive access to the value
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".