Skip to main content

InputAdapter

Trait InputAdapter 

Source
pub trait InputAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn supported_formats(&self) -> Vec<&'static str>;
    fn can_handle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 InputSource,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn parse<'life0, 'async_trait>(
        &'life0 self,
        input: InputSource,
    ) -> Pin<Box<dyn Future<Output = Result<ContextNode>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn wave_signature(&self) -> Option<String> { ... }
}
Expand description

Trait for all input adapters

Required Methods§

Source

fn name(&self) -> &'static str

Name of the adapter

Source

fn supported_formats(&self) -> Vec<&'static str>

Supported input formats/extensions

Source

fn can_handle<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 InputSource, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Can this adapter handle the given input?

Source

fn parse<'life0, 'async_trait>( &'life0 self, input: InputSource, ) -> Pin<Box<dyn Future<Output = Result<ContextNode>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Parse input into context nodes

Provided Methods§

Source

fn wave_signature(&self) -> Option<String>

Get quantum wave signature if applicable

Implementors§