Trait chain_network::grpc::proto::watch::watch_server::Watch
source · pub trait Watch: Send + Sync + 'static {
type BlockSubscriptionStream: Stream<Item = Result<Block, Status>> + Send + 'static;
type TipSubscriptionStream: Stream<Item = Result<Header, Status>> + Send + 'static;
type SyncMultiverseStream: Stream<Item = Result<Block, Status>> + Send + 'static;
// Required methods
fn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn tip_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<TipSubscriptionRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::TipSubscriptionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_multiverse<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncMultiverseRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::SyncMultiverseStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Generated trait containing gRPC methods that should be implemented for use with WatchServer.
Required Associated Types§
sourcetype BlockSubscriptionStream: Stream<Item = Result<Block, Status>> + Send + 'static
type BlockSubscriptionStream: Stream<Item = Result<Block, Status>> + Send + 'static
Server streaming response type for the BlockSubscription method.
Required Methods§
sourcefn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_subscription<'life0, 'async_trait>( &'life0 self, request: Request<BlockSubscriptionRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
get a stream of blocks succesfully processed by the node, this means they are already validated. the parent of a block will always be streamed before the block itself.
sourcefn tip_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<TipSubscriptionRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::TipSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn tip_subscription<'life0, 'async_trait>( &'life0 self, request: Request<TipSubscriptionRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::TipSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
get tip updates
sourcefn sync_multiverse<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncMultiverseRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::SyncMultiverseStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_multiverse<'life0, 'async_trait>( &'life0 self, request: Request<SyncMultiverseRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SyncMultiverseStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Fetch all blocks from the blockchain storage that are descendant from the given checkpoints, The blocks are fetched from all possible branches, observing parent-to-child order. The order in which any two blocks from divergent branches are sent is not specified and should not be relied upon.