pub struct NodeClient<T> {
    inner: Grpc<T>,
}

Fields§

§inner: Grpc<T>

Implementations§

source§

impl NodeClient<Channel>

source

pub async fn connect<D>(dst: D) -> Result<Self, Error>where D: TryInto<Endpoint>, D::Error: Into<StdError>,

Attempt to create a new client by connecting to a given endpoint.

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,

source

pub fn new(inner: T) -> Self

source

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,

source

pub fn send_gzip(self) -> Self

Compress requests with gzip.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_gzip(self) -> Self

Enable decompressing responses with gzip.

source

pub async fn handshake( &mut self, request: impl IntoRequest<HandshakeRequest> ) -> Result<Response<HandshakeResponse>, Status>

Initial handshake and authentication of the server node.

source

pub async fn client_auth( &mut self, request: impl IntoRequest<ClientAuthRequest> ) -> Result<Response<ClientAuthResponse>, Status>

Optional authentication of the client node. Called after Handshake.

source

pub async fn tip( &mut self, request: impl IntoRequest<TipRequest> ) -> Result<Response<TipResponse>, Status>

source

pub async fn peers( &mut self, request: impl IntoRequest<PeersRequest> ) -> Result<Response<PeersResponse>, Status>

Requests for some peers

source

pub async fn get_blocks( &mut self, request: impl IntoRequest<BlockIds> ) -> Result<Response<Streaming<Block>>, Status>

source

pub async fn get_headers( &mut self, request: impl IntoRequest<BlockIds> ) -> Result<Response<Streaming<Header>>, Status>

source

pub async fn get_fragments( &mut self, request: impl IntoRequest<FragmentIds> ) -> Result<Response<Streaming<Fragment>>, Status>

source

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.

source

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.

source

pub async fn pull_blocks_to_tip( &mut self, request: impl IntoRequest<PullBlocksToTipRequest> ) -> Result<Response<Streaming<Block>>, Status>

source

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.

source

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.

source

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.

source

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.

source

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>

source§

fn clone(&self) -> NodeClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for NodeClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more