Read

Trait Read 

Source
pub trait Read<I: Identifier>: Context {
    type Buffer: Buffer;

    // Required method
    fn read(&self, ident: I) -> Option<Self::Buffer>;

    // Provided methods
    fn read_spec(&self, ident: I) -> Option<Spec<Self::Buffer>> { ... }
    fn read_shape(&self, ident: I) -> Option<ShapeOf<Self::Buffer>> { ... }
}
Expand description

Trait for reading entries out of a Context.

Required Associated Types§

Source

type Buffer: Buffer

The buffer type associated with the identifier I.

Required Methods§

Source

fn read(&self, ident: I) -> Option<Self::Buffer>

Returns a copy of the value associated with ident, if it exists.

Provided Methods§

Source

fn read_spec(&self, ident: I) -> Option<Spec<Self::Buffer>>

Returns a specification of the value associated with ident, if it exists.

Source

fn read_shape(&self, ident: I) -> Option<ShapeOf<Self::Buffer>>

Returns the shape of the value associated with ident, if it exists.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§