Skip to main content

DmaTransfer

Trait DmaTransfer 

Source
pub trait DmaTransfer {
    type Buffer;

    // Required methods
    fn is_done(&self) -> bool;
    fn wait(self) -> Self::Buffer;
}
Expand description

An in-progress DMA transfer that holds the framebuffer until completion.

The buffer is inaccessible while this token is live — the only way to get it back is to call wait, which blocks until the hardware has finished reading.

Implementors for real hardware should cancel the DMA in their Drop impl so that dropping a token without waiting is always safe.

Required Associated Types§

Source

type Buffer

The buffer type that is returned when the transfer completes.

Required Methods§

Source

fn is_done(&self) -> bool

Returns true if the DMA hardware has finished the transfer.

Source

fn wait(self) -> Self::Buffer

Block until the transfer is complete and return the framebuffer.

Consuming self ensures the buffer cannot be accessed while DMA is still reading it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§