Trait hff_std::DataSource

source ·
pub trait DataSource: Debug {
    // Required methods
    fn len(&self) -> Option<u64>;
    fn prepare(&mut self) -> Result<u64>;
    fn as_datatype(&mut self) -> &mut dyn Any;
}
Expand description

A chunk data source.

Required Methods§

source

fn len(&self) -> Option<u64>

Length of the data if available.

source

fn prepare(&mut self) -> Result<u64>

Prepare the chunk data if the length was not available. Returns the size of the data that will be stored.

source

fn as_datatype(&mut self) -> &mut dyn Any

Get the underlying data type.

Trait Implementations§

source§

impl<'a> TryInto<&'a mut dyn StdWriter> for &'a mut Box<dyn DataSource>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<&'a mut dyn StdWriter>

Performs the conversion.

Implementors§