Trait ChainReadChannelOperations
pub trait ChainReadChannelOperations {
type Error: Error + Send + Sync + 'static;
// Required methods
fn me(&self) -> &Address;
fn channel_by_id(
&self,
channel_id: &HashBase<CoreWrapper<Keccak256Core>>,
) -> Result<Option<ChannelEntry>, Self::Error>;
fn stream_channels<'a>(
&'a self,
selector: ChannelSelector,
) -> Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, Self::Error>;
// Provided method
fn channel_by_parties(
&self,
src: &Address,
dst: &Address,
) -> Result<Option<ChannelEntry>, Self::Error> { ... }
}Expand description
On-chain read operations regarding channels.
Required Associated Types§
Required Methods§
fn channel_by_id(
&self,
channel_id: &HashBase<CoreWrapper<Keccak256Core>>,
) -> Result<Option<ChannelEntry>, Self::Error>
fn channel_by_id( &self, channel_id: &HashBase<CoreWrapper<Keccak256Core>>, ) -> Result<Option<ChannelEntry>, Self::Error>
Returns a single channel given channel_id.
fn stream_channels<'a>(
&'a self,
selector: ChannelSelector,
) -> Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, Self::Error>
fn stream_channels<'a>( &'a self, selector: ChannelSelector, ) -> Result<Pin<Box<dyn Stream<Item = ChannelEntry> + Send + 'a>>, Self::Error>
Returns a stream of channels given the ChannelSelector.
Provided Methods§
fn channel_by_parties(
&self,
src: &Address,
dst: &Address,
) -> Result<Option<ChannelEntry>, Self::Error>
fn channel_by_parties( &self, src: &Address, dst: &Address, ) -> Result<Option<ChannelEntry>, Self::Error>
Returns a single channel given src and dst.