Skip to main content

BufferReads

Trait BufferReads 

Source
pub trait BufferReads {
    // Required method
    fn read(
        &mut self,
        view: ResourceId,
        word: u32,
        count: u8,
    ) -> Result<[u32; 4], String>;

    // Provided method
    fn words(&mut self, view: ResourceId) -> Result<u32, String> { ... }
}
Expand description

A program’s buffers, as the caller answers them: count (1 to 4) words from word word of the buffer view, and a buffer’s length in words.

Required Methods§

Source

fn read( &mut self, view: ResourceId, word: u32, count: u8, ) -> Result<[u32; 4], String>

Answer count (1 to 4) words from word word of view; lanes past count are 0.

Provided Methods§

Source

fn words(&mut self, view: ResourceId) -> Result<u32, String>

The buffer’s length in words: long enough for any read, unless the caller says otherwise.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§