Skip to main content

EntitySource

Trait EntitySource 

Source
pub trait EntitySource:
    Send
    + Sync
    + Debug {
    // Required method
    fn decode(&self, span: Range<usize>) -> Entity;
}
Expand description

Decodes the entities of a lazily loaded Model.

Implemented by codecs; the model never knows what format a span is in.

Required Methods§

Source

fn decode(&self, span: Range<usize>) -> Entity

Decodes the entity whose record occupies span of the source.

§Panics

When the record no longer decodes, which means the source changed after the codec validated it. A codec must never register a span it has not validated.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§