Persist

Trait Persist 

Source
pub trait Persist:
    Debug
    + Send
    + Sync
    + DynClone {
    type Input: Chunk;
    type Output: Chunk;

    // Required methods
    fn setup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store<'life0, 'async_trait>(
        &'life0 self,
        node: Node<Self::Input>,
    ) -> Pin<Box<dyn Future<Output = Result<Node<Self::Output>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn batch_store<'life0, 'async_trait>(
        &'life0 self,
        nodes: Vec<Node<Self::Input>>,
    ) -> Pin<Box<dyn Future<Output = IndexingStream<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn batch_size(&self) -> Option<usize> { ... }
    fn name(&self) -> &'static str { ... }
}
Expand description

Persists nodes

Required Associated Types§

Required Methods§

Source

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

Source

fn store<'life0, 'async_trait>( &'life0 self, node: Node<Self::Input>, ) -> Pin<Box<dyn Future<Output = Result<Node<Self::Output>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn batch_store<'life0, 'async_trait>( &'life0 self, nodes: Vec<Node<Self::Input>>, ) -> Pin<Box<dyn Future<Output = IndexingStream<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

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

Source

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

Trait Implementations§

Source§

impl<I: Chunk, O: Chunk> Persist for &dyn Persist<Input = I, Output = O>

Source§

type Input = I

Source§

type Output = O

Source§

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

Source§

fn store<'life0, 'async_trait>( &'life0 self, node: Node<I>, ) -> Pin<Box<dyn Future<Output = Result<Node<O>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn batch_store<'life0, 'async_trait>( &'life0 self, nodes: Vec<Node<I>>, ) -> Pin<Box<dyn Future<Output = IndexingStream<O>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

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

Source§

impl<I: Chunk, O: Chunk> Persist for Box<dyn Persist<Input = I, Output = O>>

Source§

type Input = I

Source§

type Output = O

Source§

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

Source§

fn store<'life0, 'async_trait>( &'life0 self, node: Node<I>, ) -> Pin<Box<dyn Future<Output = Result<Node<O>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn batch_store<'life0, 'async_trait>( &'life0 self, nodes: Vec<Node<I>>, ) -> Pin<Box<dyn Future<Output = IndexingStream<O>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

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

Implementations on Foreign Types§

Source§

impl<I: Chunk, O: Chunk> Persist for Box<dyn Persist<Input = I, Output = O>>

Source§

type Input = I

Source§

type Output = O

Source§

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

Source§

fn store<'life0, 'async_trait>( &'life0 self, node: Node<I>, ) -> Pin<Box<dyn Future<Output = Result<Node<O>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn batch_store<'life0, 'async_trait>( &'life0 self, nodes: Vec<Node<I>>, ) -> Pin<Box<dyn Future<Output = IndexingStream<O>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

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

Implementors§

Source§

impl Persist for MockPersist

Source§

impl<I: Chunk, O: Chunk> Persist for &dyn Persist<Input = I, Output = O>

Source§

type Input = I

Source§

type Output = O

Source§

impl<I: Chunk, O: Chunk> Persist for Arc<dyn Persist<Input = I, Output = O>>

Source§

type Input = I

Source§

type Output = O