InterfaceTrait

Trait InterfaceTrait 

Source
pub trait InterfaceTrait {
    // Required methods
    fn get_more_data(
        &mut self,
        _layer_list: Layers,
        data: &mut Data,
    ) -> Result<(), Vec<TramexError>>;
    fn close(&mut self) -> Result<(), TramexError>;
    fn is_fully_read(&self) -> bool;

    // Provided methods
    fn supports_preloading(&self) -> bool { ... }
    fn get_total_event_count(&self) -> Option<usize> { ... }
}
Expand description

Interface trait

Required Methods§

Source

fn get_more_data( &mut self, _layer_list: Layers, data: &mut Data, ) -> Result<(), Vec<TramexError>>

Get more data

§Errors

Return an error if the data is not received correctly

Source

fn close(&mut self) -> Result<(), TramexError>

Try to close the interface

§Errors

Return an error if its fail

Source

fn is_fully_read(&self) -> bool

Check if all data has been read

Provided Methods§

Source

fn supports_preloading(&self) -> bool

Check if this interface supports preloading (e.g., file can preload, websocket cannot)

Source

fn get_total_event_count(&self) -> Option<usize>

Get total event count if known (Some for files, None for websockets)

Implementors§