Skip to main content

WriteBuffer

Trait WriteBuffer 

Source
pub unsafe trait WriteBuffer {
    // Required method
    unsafe fn write_buffer(&mut self) -> (*mut u8, usize);
}
Expand description

Trait for buffers that can be given to DMA for writing.

§Safety

Once the write_buffer method has been called, it is unsafe to call any &mut self methods, except for write_buffer, on this object as long as the returned value is in use (by DMA).

Required Methods§

Source

unsafe fn write_buffer(&mut self) -> (*mut u8, usize)

Provide a buffer usable for DMA writes.

The return value is:

  • pointer to the start of the buffer
  • buffer size in bytes
§Safety

Once this method has been called, it is unsafe to call any &mut self methods, except for write_buffer, on this object as long as the returned value is in use (by DMA).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<W, const S: usize> WriteBuffer for &mut [W; S]
where W: Word,

Available on crate feature unstable only.
Source§

unsafe fn write_buffer(&mut self) -> (*mut u8, usize)

Source§

impl<W, const S: usize> WriteBuffer for [W; S]
where W: Word,

Available on crate feature unstable only.
Source§

unsafe fn write_buffer(&mut self) -> (*mut u8, usize)

Source§

impl<W> WriteBuffer for &mut [W]
where W: Word,

Available on crate feature unstable only.
Source§

unsafe fn write_buffer(&mut self) -> (*mut u8, usize)

Implementors§