pub struct JormungandrServerImpl {
data: Arc<RwLock<MockServerData>>,
}
Fields§
§data: Arc<RwLock<MockServerData>>
Implementations§
source§impl JormungandrServerImpl
impl JormungandrServerImpl
pub fn new(data: Arc<RwLock<MockServerData>>) -> Self
Trait Implementations§
source§impl Node for JormungandrServerImpl
impl Node for JormungandrServerImpl
§type PullBlocksStream = ReceiverStream<Result<Block, Status>>
type PullBlocksStream = ReceiverStream<Result<Block, Status>>
Server streaming response type for the PullBlocks method.
§type PullBlocksToTipStream = ReceiverStream<Result<Block, Status>>
type PullBlocksToTipStream = ReceiverStream<Result<Block, Status>>
Server streaming response type for the PullBlocksToTip method.
§type GetBlocksStream = ReceiverStream<Result<Block, Status>>
type GetBlocksStream = ReceiverStream<Result<Block, Status>>
Server streaming response type for the GetBlocks method.
§type PullHeadersStream = ReceiverStream<Result<Header, Status>>
type PullHeadersStream = ReceiverStream<Result<Header, Status>>
Server streaming response type for the PullHeaders method.
§type GetHeadersStream = ReceiverStream<Result<Header, Status>>
type GetHeadersStream = ReceiverStream<Result<Header, Status>>
Server streaming response type for the GetHeaders method.
§type GetFragmentsStream = ReceiverStream<Result<Fragment, Status>>
type GetFragmentsStream = ReceiverStream<Result<Fragment, Status>>
Server streaming response type for the GetFragments method.
§type BlockSubscriptionStream = ReceiverStream<Result<BlockEvent, Status>>
type BlockSubscriptionStream = ReceiverStream<Result<BlockEvent, Status>>
Server streaming response type for the BlockSubscription method.
§type FragmentSubscriptionStream = ReceiverStream<Result<Fragment, Status>>
type FragmentSubscriptionStream = ReceiverStream<Result<Fragment, Status>>
Server streaming response type for the FragmentSubscription method.
§type GossipSubscriptionStream = ReceiverStream<Result<Gossip, Status>>
type GossipSubscriptionStream = ReceiverStream<Result<Gossip, Status>>
Server streaming response type for the GossipSubscription method.
source§fn handshake<'life0, 'async_trait>(
&'life0 self,
request: Request<HandshakeRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<HandshakeResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handshake<'life0, 'async_trait>( &'life0 self, request: Request<HandshakeRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<HandshakeResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Initial handshake and authentication of the server node.
source§fn client_auth<'life0, 'async_trait>(
&'life0 self,
request: Request<ClientAuthRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ClientAuthResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn client_auth<'life0, 'async_trait>( &'life0 self, request: Request<ClientAuthRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<ClientAuthResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Optional authentication of the client node.
Called after Handshake.
fn tip<'life0, 'async_trait>( &'life0 self, _request: Request<TipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<TipResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn peers<'life0, 'async_trait>(
&'life0 self,
_request: Request<PeersRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<PeersResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peers<'life0, 'async_trait>( &'life0 self, _request: Request<PeersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<PeersResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Requests for some peers
fn get_blocks<'life0, 'async_trait>( &'life0 self, request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetBlocksStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn get_headers<'life0, 'async_trait>( &'life0 self, _request: Request<BlockIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetHeadersStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn get_fragments<'life0, 'async_trait>( &'life0 self, _request: Request<FragmentIds> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetFragmentsStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn pull_headers<'life0, 'async_trait>(
&'life0 self,
_request: Request<PullHeadersRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullHeadersStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pull_headers<'life0, 'async_trait>( &'life0 self, _request: Request<PullHeadersRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullHeadersStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Requests headers of blocks in the chain in the chronological order,
given a selection of possible starting blocks known by the requester,
and the identifier of the end block to be included in the returned
sequence.
source§fn pull_blocks<'life0, 'async_trait>(
&'life0 self,
request: Request<PullBlocksRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pull_blocks<'life0, 'async_trait>( &'life0 self, request: Request<PullBlocksRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Requests blocks in the chain in the chronological order, given a selection
of possible starting blocks known by the requester, and the identifier of
the end block to be included in the returned sequence.
fn pull_blocks_to_tip<'life0, 'async_trait>( &'life0 self, _request: Request<PullBlocksToTipRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PullBlocksToTipStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn push_headers<'life0, 'async_trait>(
&'life0 self,
_request: Request<Streaming<Header>>
) -> Pin<Box<dyn Future<Output = Result<Response<PushHeadersResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn push_headers<'life0, 'async_trait>( &'life0 self, _request: Request<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<PushHeadersResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Sends headers of blocks to the service in response to a
missing
item received from the BlockSubscription response stream.
The headers are streamed the in chronological order of the chain.source§fn upload_blocks<'life0, 'async_trait>(
&'life0 self,
_request: Request<Streaming<Block>>
) -> Pin<Box<dyn Future<Output = Result<Response<UploadBlocksResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upload_blocks<'life0, 'async_trait>( &'life0 self, _request: Request<Streaming<Block>> ) -> Pin<Box<dyn Future<Output = Result<Response<UploadBlocksResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Uploads blocks to the service in response to a
solicit
item
received from the BlockSubscription response stream.source§fn block_subscription<'life0, 'async_trait>(
&'life0 self,
_request: Request<Streaming<Header>>
) -> 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<Streaming<Header>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Establishes a bidirectional stream to exchange information on new
blocks created or accepted by the peers.
source§fn fragment_subscription<'life0, 'async_trait>(
&'life0 self,
_request: Request<Streaming<Fragment>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::FragmentSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fragment_subscription<'life0, 'async_trait>( &'life0 self, _request: Request<Streaming<Fragment>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::FragmentSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Establishes a bidirectional stream to exchange information on new
block fragments created or accepted by the peers.
source§fn gossip_subscription<'life0, 'async_trait>(
&'life0 self,
_request: Request<Streaming<Gossip>>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GossipSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn gossip_subscription<'life0, 'async_trait>( &'life0 self, _request: Request<Streaming<Gossip>> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GossipSubscriptionStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Establishes a bidirectional stream to exchange information on new
network peers.
Auto Trait Implementations§
impl RefUnwindSafe for JormungandrServerImpl
impl Send for JormungandrServerImpl
impl Sync for JormungandrServerImpl
impl Unpin for JormungandrServerImpl
impl UnwindSafe for JormungandrServerImpl
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request