Struct chain_network::grpc::proto::node::node_client::NodeClient
source · pub struct NodeClient<T> {
inner: Grpc<T>,
}
Fields§
§inner: Grpc<T>
Implementations§
source§impl NodeClient<Channel>
impl NodeClient<Channel>
source§impl<T> NodeClient<T>where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> NodeClient<T>where T: GrpcService<BoxBody>, T::ResponseBody: Body + Send + 'static, T::Error: Into<StdError>, <T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_interceptor<F>( inner: T, interceptor: F ) -> NodeClient<InterceptedService<T, F>>where F: Interceptor, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_gzip(self) -> Self
pub fn send_gzip(self) -> Self
Compress requests with gzip
.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_gzip(self) -> Self
pub fn accept_gzip(self) -> Self
Enable decompressing responses with gzip
.
sourcepub async fn handshake(
&mut self,
request: impl IntoRequest<HandshakeRequest>
) -> Result<Response<HandshakeResponse>, Status>
pub async fn handshake( &mut self, request: impl IntoRequest<HandshakeRequest> ) -> Result<Response<HandshakeResponse>, Status>
Initial handshake and authentication of the server node.
sourcepub async fn client_auth(
&mut self,
request: impl IntoRequest<ClientAuthRequest>
) -> Result<Response<ClientAuthResponse>, Status>
pub async fn client_auth( &mut self, request: impl IntoRequest<ClientAuthRequest> ) -> Result<Response<ClientAuthResponse>, Status>
Optional authentication of the client node. Called after Handshake.
pub async fn tip( &mut self, request: impl IntoRequest<TipRequest> ) -> Result<Response<TipResponse>, Status>
sourcepub async fn peers(
&mut self,
request: impl IntoRequest<PeersRequest>
) -> Result<Response<PeersResponse>, Status>
pub async fn peers( &mut self, request: impl IntoRequest<PeersRequest> ) -> Result<Response<PeersResponse>, Status>
Requests for some peers
pub async fn get_blocks( &mut self, request: impl IntoRequest<BlockIds> ) -> Result<Response<Streaming<Block>>, Status>
pub async fn get_headers( &mut self, request: impl IntoRequest<BlockIds> ) -> Result<Response<Streaming<Header>>, Status>
pub async fn get_fragments( &mut self, request: impl IntoRequest<FragmentIds> ) -> Result<Response<Streaming<Fragment>>, Status>
sourcepub async fn pull_headers(
&mut self,
request: impl IntoRequest<PullHeadersRequest>
) -> Result<Response<Streaming<Header>>, Status>
pub async fn pull_headers( &mut self, request: impl IntoRequest<PullHeadersRequest> ) -> Result<Response<Streaming<Header>>, Status>
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.
sourcepub async fn pull_blocks(
&mut self,
request: impl IntoRequest<PullBlocksRequest>
) -> Result<Response<Streaming<Block>>, Status>
pub async fn pull_blocks( &mut self, request: impl IntoRequest<PullBlocksRequest> ) -> Result<Response<Streaming<Block>>, Status>
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.
pub async fn pull_blocks_to_tip( &mut self, request: impl IntoRequest<PullBlocksToTipRequest> ) -> Result<Response<Streaming<Block>>, Status>
sourcepub async fn push_headers(
&mut self,
request: impl IntoStreamingRequest<Message = Header>
) -> Result<Response<PushHeadersResponse>, Status>
pub async fn push_headers( &mut self, request: impl IntoStreamingRequest<Message = Header> ) -> Result<Response<PushHeadersResponse>, Status>
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.
sourcepub async fn upload_blocks(
&mut self,
request: impl IntoStreamingRequest<Message = Block>
) -> Result<Response<UploadBlocksResponse>, Status>
pub async fn upload_blocks( &mut self, request: impl IntoStreamingRequest<Message = Block> ) -> Result<Response<UploadBlocksResponse>, Status>
Uploads blocks to the service in response to a solicit
item
received from the BlockSubscription response stream.
sourcepub async fn block_subscription(
&mut self,
request: impl IntoStreamingRequest<Message = Header>
) -> Result<Response<Streaming<BlockEvent>>, Status>
pub async fn block_subscription( &mut self, request: impl IntoStreamingRequest<Message = Header> ) -> Result<Response<Streaming<BlockEvent>>, Status>
Establishes a bidirectional stream to exchange information on new blocks created or accepted by the peers.
sourcepub async fn fragment_subscription(
&mut self,
request: impl IntoStreamingRequest<Message = Fragment>
) -> Result<Response<Streaming<Fragment>>, Status>
pub async fn fragment_subscription( &mut self, request: impl IntoStreamingRequest<Message = Fragment> ) -> Result<Response<Streaming<Fragment>>, Status>
Establishes a bidirectional stream to exchange information on new block fragments created or accepted by the peers.
sourcepub async fn gossip_subscription(
&mut self,
request: impl IntoStreamingRequest<Message = Gossip>
) -> Result<Response<Streaming<Gossip>>, Status>
pub async fn gossip_subscription( &mut self, request: impl IntoStreamingRequest<Message = Gossip> ) -> Result<Response<Streaming<Gossip>>, Status>
Establishes a bidirectional stream to exchange information on new network peers.
Trait Implementations§
source§impl<T: Clone> Clone for NodeClient<T>
impl<T: Clone> Clone for NodeClient<T>
source§fn clone(&self) -> NodeClient<T>
fn clone(&self) -> NodeClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for NodeClient<T>where T: RefUnwindSafe,
impl<T> Send for NodeClient<T>where T: Send,
impl<T> Sync for NodeClient<T>where T: Sync,
impl<T> Unpin for NodeClient<T>where T: Unpin,
impl<T> UnwindSafe for NodeClient<T>where T: UnwindSafe,
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
§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>
T
in a tonic::Request