ChainReadChannelOperations

Trait ChainReadChannelOperations 

Source
pub trait ChainReadChannelOperations {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn me(&self) -> &Address;
    fn channel_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn stream_channels<'a, 'async_trait>(
        &'a self,
        selector: ChannelSelector,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
       where 'a: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn channel_by_parties<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        src: &'life1 Address,
        dst: &'life2 Address,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: Sync + 'async_trait { ... }
}
Expand description

On-chain read operations regarding channels.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn me(&self) -> &Address

Returns on-chain Address of the current node.

Source

fn channel_by_id<'life0, 'life1, 'async_trait>( &'life0 self, channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns a single channel given channel_id.

Source

fn stream_channels<'a, 'async_trait>( &'a self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Returns a stream of channels given the ChannelSelector.

Provided Methods§

Source

fn channel_by_parties<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 Address, dst: &'life2 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Returns a single channel given src and dst.

Implementations on Foreign Types§

Source§

impl<'b, T> ChainReadChannelOperations for &'b T

Source§

type Error = <T as ChainReadChannelOperations>::Error

Source§

fn me(&self) -> &Address

Source§

fn channel_by_parties<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 Address, dst: &'life2 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <&'b T as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, &'b T: Sync + 'async_trait,

Source§

fn channel_by_id<'life0, 'life1, 'async_trait>( &'life0 self, channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <&'b T as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &'b T: 'async_trait,

Source§

fn stream_channels<'a, 'async_trait>( &'a self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, <&'b T as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: 'async_trait,

Source§

impl<T> ChainReadChannelOperations for Box<T>

Source§

type Error = <T as ChainReadChannelOperations>::Error

Source§

fn me(&self) -> &Address

Source§

fn channel_by_parties<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 Address, dst: &'life2 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <Box<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Box<T>: Sync + 'async_trait,

Source§

fn channel_by_id<'life0, 'life1, 'async_trait>( &'life0 self, channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <Box<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<T>: 'async_trait,

Source§

fn stream_channels<'a, 'async_trait>( &'a self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, <Box<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: 'async_trait,

Source§

impl<T> ChainReadChannelOperations for Arc<T>

Source§

type Error = <T as ChainReadChannelOperations>::Error

Source§

fn me(&self) -> &Address

Source§

fn channel_by_parties<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 Address, dst: &'life2 Address, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <Arc<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Arc<T>: Sync + 'async_trait,

Source§

fn channel_by_id<'life0, 'life1, 'async_trait>( &'life0 self, channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, <Arc<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Source§

fn stream_channels<'a, 'async_trait>( &'a self, selector: ChannelSelector, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, <Arc<T> as ChainReadChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: 'async_trait,

Implementors§