Skip to main content

RelayBuilder

Trait RelayBuilder 

Source
pub trait RelayBuilder: MemoryBounds {
    // Required methods
    fn outputs(&self) -> &[OutputDefinition<PayloadType>];
    fn build<'life0, 'async_trait>(
        &'life0 self,
        context: ComponentContext,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Relay + Send>, GenericError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A relay builder.

Relay builders are responsible for creating instances of Relays, as well as describing high-level aspects of the built relay, such as the payload types emitted.

Required Methods§

Source

fn outputs(&self) -> &[OutputDefinition<PayloadType>]

Payload outputs exposed by this source.

Source

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

Builds an instance of the relay.

§Errors

If the relay can’t be built for any reason, an error is returned.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§