pub struct WriteOnly<T: Copy>(_);
Expand description

A volatile wrapper which only allows write operations.

The size of this struct is the same as the contained type.

Implementations

Constructs a new write only volatile wrapper around the given value.

use volatile::WriteOnly;

let value = WriteOnly::new(0u32);
Panics

This function never panics.

Performs a volatile write of value value into the contained value. Functionally identical to Volatile::write.

use volatile::WriteOnly;

let mut value = WriteOnly::new(0u32);

value.write(42u32);
Panics

This method never panics.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.