pub struct PeerRpcClient<T, I> { /* private fields */ }Expand description
Authenticated client for stable peer query, command, and diagnostic endpoints.
Implementations§
Source§impl<T, I> PeerRpcClient<T, I>where
T: PeerTransportProvider,
I: PeerRpcTokenIssuer,
impl<T, I> PeerRpcClient<T, I>where
T: PeerTransportProvider,
I: PeerRpcTokenIssuer,
Sourcepub fn new(
source_identity: CoreIdentity,
config: PeerRpcClientConfig,
transport: T,
token_issuer: I,
) -> Self
pub fn new( source_identity: CoreIdentity, config: PeerRpcClientConfig, transport: T, token_issuer: I, ) -> Self
Creates an authenticated peer RPC client.
Sourcepub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
pub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
Replaces the shared cancellation token used by I/O and retry waits.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Reports whether this client has been cancelled.
Sourcepub fn query(
&self,
endpoint_url: &str,
request: PeerRpcOutboundRequest,
) -> Result<PeerRpcResponse, PeerRpcError>
pub fn query( &self, endpoint_url: &str, request: PeerRpcOutboundRequest, ) -> Result<PeerRpcResponse, PeerRpcError>
Executes a peer query.
Sourcepub fn command(
&self,
endpoint_url: &str,
request: PeerRpcOutboundRequest,
) -> Result<PeerRpcResponse, PeerRpcError>
pub fn command( &self, endpoint_url: &str, request: PeerRpcOutboundRequest, ) -> Result<PeerRpcResponse, PeerRpcError>
Executes a peer command.
Sourcepub fn health(
&self,
endpoint_url: &str,
) -> Result<PeerHealthResponse, PeerRpcError>
pub fn health( &self, endpoint_url: &str, ) -> Result<PeerHealthResponse, PeerRpcError>
Reads the authenticated peer health endpoint.
Sourcepub fn advertisement(
&self,
endpoint_url: &str,
) -> Result<PeerAdvertisementV1, PeerRpcError>
pub fn advertisement( &self, endpoint_url: &str, ) -> Result<PeerAdvertisementV1, PeerRpcError>
Reads and returns the authenticated peer runtime manifest. Loads the versioned public advertisement exposed by a peer.
Trait Implementations§
Source§impl<T, I> PeerRpcClientExecutor for PeerRpcClient<T, I>where
T: PeerTransportProvider,
I: PeerRpcTokenIssuer,
impl<T, I> PeerRpcClientExecutor for PeerRpcClient<T, I>where
T: PeerTransportProvider,
I: PeerRpcTokenIssuer,
Source§fn call_peer(
&self,
endpoint_url: &str,
kind: PeerRpcCallKind,
request: PeerRpcOutboundRequest,
) -> Result<PeerRpcResponse, PeerRpcError>
fn call_peer( &self, endpoint_url: &str, kind: PeerRpcCallKind, request: PeerRpcOutboundRequest, ) -> Result<PeerRpcResponse, PeerRpcError>
Executes one query or command against
endpoint_url.Auto Trait Implementations§
impl<T, I> Freeze for PeerRpcClient<T, I>
impl<T, I> RefUnwindSafe for PeerRpcClient<T, I>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<T, I> Send for PeerRpcClient<T, I>
impl<T, I> Sync for PeerRpcClient<T, I>
impl<T, I> Unpin for PeerRpcClient<T, I>
impl<T, I> UnsafeUnpin for PeerRpcClient<T, I>where
T: UnsafeUnpin,
I: UnsafeUnpin,
impl<T, I> UnwindSafe for PeerRpcClient<T, I>where
T: UnwindSafe,
I: 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
Mutably borrows from an owned value. Read more