pub struct CrpcSnapControlClient { /* private fields */ }Expand description
Connect RPC client for the SNAP control plane API.
Implementations§
Source§impl CrpcSnapControlClient
impl CrpcSnapControlClient
Sourcepub fn new_with_client(base_url: &Url, client: Client) -> Result<Self>
pub fn new_with_client(base_url: &Url, client: Client) -> Result<Self>
Creates a new client with the provided reqwest::Client.
Sourcepub fn use_token_source(
&mut self,
token_source: Arc<dyn TokenSource>,
) -> &mut Self
pub fn use_token_source( &mut self, token_source: Arc<dyn TokenSource>, ) -> &mut Self
Uses the provided token source for authentication.
Methods from Deref<Target = CrpcClient>§
Sourcepub async fn unary_request<Req, Res>(
&self,
path: &str,
req: Req,
) -> Result<Res, CrpcClientError>
pub async fn unary_request<Req, Res>( &self, path: &str, req: Req, ) -> Result<Res, CrpcClientError>
Unary RPC request.
Trait Implementations§
Source§impl ControlPlaneApi for CrpcSnapControlClient
impl ControlPlaneApi for CrpcSnapControlClient
Source§fn get_data_plane_address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GetDataPlaneAddressResponse, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_data_plane_address<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GetDataPlaneAddressResponse, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the SNAP data plane address.
Source§fn register_snaptun_identity<'life0, 'async_trait>(
&'life0 self,
initiator_identity: PublicKey,
psk_share: Option<[u8; 32]>,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_snaptun_identity<'life0, 'async_trait>(
&'life0 self,
initiator_identity: PublicKey,
psk_share: Option<[u8; 32]>,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register a static identity for a snaptun connection.
Source§impl Deref for CrpcSnapControlClient
impl Deref for CrpcSnapControlClient
Source§impl SnapTunControlPlaneClient for CrpcSnapControlClient
impl SnapTunControlPlaneClient for CrpcSnapControlClient
Source§fn register_identity<'life0, 'async_trait>(
&'life0 self,
initiator_identity: PublicKey,
psk_share: Option<[u8; 32]>,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_identity<'life0, 'async_trait>(
&'life0 self,
initiator_identity: PublicKey,
psk_share: Option<[u8; 32]>,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register an identity with the control plane.
Source§fn register_identity_with_retries<'life0, 'async_trait>(
&'life0 self,
identity: PublicKey,
psk_share: Option<[u8; 32]>,
backoff: ExponentialBackoff,
max_attempts: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn register_identity_with_retries<'life0, 'async_trait>(
&'life0 self,
identity: PublicKey,
psk_share: Option<[u8; 32]>,
backoff: ExponentialBackoff,
max_attempts: u32,
) -> Pin<Box<dyn Future<Output = Result<Option<[u8; 32]>, CrpcClientError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Register an identity with the control plane with retries.
Auto Trait Implementations§
impl !Freeze for CrpcSnapControlClient
impl !RefUnwindSafe for CrpcSnapControlClient
impl Send for CrpcSnapControlClient
impl Sync for CrpcSnapControlClient
impl Unpin for CrpcSnapControlClient
impl UnsafeUnpin for CrpcSnapControlClient
impl !UnwindSafe for CrpcSnapControlClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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