Skip to main content

IoTypeMut

Trait IoTypeMut 

Source
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:

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§

Source

type Target: IoType

The type of the value

Required Methods§

Source

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".

Implementors§

Source§

impl<T> IoTypeMut for T
where T: IoType,