ReadSource

Trait ReadSource 

Source
pub trait ReadSource: Sync + Send {
    type Open: ReadSourceOpen;
    type Iter: Iterator<Item = RusticResult<ReadSourceEntry<Self::Open>>>;

    // Required methods
    fn size(&self) -> RusticResult<Option<u64>>;
    fn entries(&self) -> Self::Iter;
}
Expand description

Trait for backends that can read from a source.

This trait is implemented by all backends that can read data from a source.

Required Associated Types§

Source

type Open: ReadSourceOpen

The type used to handle open source files

Source

type Iter: Iterator<Item = RusticResult<ReadSourceEntry<Self::Open>>>

The iterator we use to iterate over the source entries

Required Methods§

Source

fn size(&self) -> RusticResult<Option<u64>>

Returns the size of the source.

§Errors
  • If the size could not be determined.
§Returns

The size of the source, if it is known.

Source

fn entries(&self) -> Self::Iter

Returns an iterator over the entries of the source.

Implementors§