swiftide_core::indexing_traits

Trait Transformer

source
pub trait Transformer:
    Send
    + Sync
    + DynClone {
    // Required method
    fn transform_node<'life0, 'async_trait>(
        &'life0 self,
        node: Node,
    ) -> Pin<Box<dyn Future<Output = Result<Node>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

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

Transforms single nodes into single nodes

Required Methods§

source

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

Provided Methods§

source

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

Overrides the default concurrency of the pipeline

source

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

Trait Implementations§

source§

impl Transformer for &dyn Transformer

source§

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

source§

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

Overrides the default concurrency of the pipeline
source§

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

source§

impl Transformer for Box<dyn Transformer>

source§

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

source§

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

Overrides the default concurrency of the pipeline
source§

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

source§

impl WithIndexingDefaults for Box<dyn Transformer>

source§

fn with_indexing_defaults(&mut self, indexing_defaults: IndexingDefaults)

source§

impl WithIndexingDefaults for dyn Transformer

source§

fn with_indexing_defaults(&mut self, _indexing_defaults: IndexingDefaults)

Implementations on Foreign Types§

source§

impl Transformer for Box<dyn Transformer>

source§

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

source§

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

source§

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

Implementors§

source§

impl Transformer for &dyn Transformer

source§

impl<F> Transformer for F
where F: Fn(Node) -> Result<Node> + Send + Sync + Clone,

Use a closure as a transformer