Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required method
    fn layer(&self, origin: Origin) -> Read;
}
Expand description

Where layers come from. One implementation per platform, plus whatever the tests need.

Returning None for a layer means this platform has no such source, or the source is empty. It is not an error and is not a refusal.

Required Methods§

Source

fn layer(&self, origin: Origin) -> Read

This layer, read now rather than remembered. An implementation that caches is the bypass concept 10 warns about.

Ok(None) means this platform has no such source, or it is not there. That is not an error and not a refusal. An Err means the source exists and could not be understood, which is a different thing entirely and must not be flattened into the first.

§Errors

See Error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§