Skip to main content

AtomicIoHandle

Trait AtomicIoHandle 

Source
pub trait AtomicIoHandle: ReadHandle + WriteHandle {
    // Required methods
    unsafe fn atomic_swap_raw(&self, value: Self::Base) -> Self::Base;
    unsafe fn atomic_set_bits_raw(&self, bits: Self::Base) -> Self::Base;
    unsafe fn atomic_clear_bits_raw(&self, bits: Self::Base) -> Self::Base;
}
Expand description

Represents an abstracted means of atomic read-modify-write register I/O.

Required Methods§

Source

unsafe fn atomic_swap_raw(&self, value: Self::Base) -> Self::Base

Atomically swaps the contents of the register with the provided value, returning the original contents.

§Safety

The caller must guarantee…

  • that the value-agnostic, implementation-specific preconditions for a sound write are met;

  • and further that the particular value will not cause undefined behaviour when written (in an implementation-specific way).

Source

unsafe fn atomic_set_bits_raw(&self, bits: Self::Base) -> Self::Base

Atomically sets the provided bits on the contents of the register, returning the original contents.

§Safety

The caller must guarantee…

  • that the value-agnostic, implementation-specific preconditions for a sound write are met;

  • and further that the particular value will not cause undefined behaviour when written (in an implementation-specific way).

Source

unsafe fn atomic_clear_bits_raw(&self, bits: Self::Base) -> Self::Base

Atomically clears the provided bits on the contents of the register, returning the original contents.

§Safety

The caller must guarantee…

  • that the value-agnostic, implementation-specific preconditions for a sound write are met;

  • and further that the particular value will not cause undefined behaviour when written (in an implementation-specific way).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§