pub struct PairingClient<T> { /* private fields */ }Expand description
A service to pair signer-less clients with an existing signer.
Implementations§
Source§impl PairingClient<Channel>
impl PairingClient<Channel>
Source§impl<T> PairingClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> PairingClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PairingClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn pair_device(
&mut self,
request: impl IntoRequest<PairDeviceRequest>,
) -> Result<Response<PairDeviceResponse>, Status>
pub async fn pair_device( &mut self, request: impl IntoRequest<PairDeviceRequest>, ) -> Result<Response<PairDeviceResponse>, Status>
Initiates a new Pairing Sessions. This is called by the new device that wants to request a pairing from an existing device. The session lifetime is bound to the stream so closing the stream destroys the session.
Sourcepub async fn get_pairing_data(
&mut self,
request: impl IntoRequest<GetPairingDataRequest>,
) -> Result<Response<GetPairingDataResponse>, Status>
pub async fn get_pairing_data( &mut self, request: impl IntoRequest<GetPairingDataRequest>, ) -> Result<Response<GetPairingDataResponse>, Status>
Returns the pairing related data that belongs to a pairing session. This is meant to be called from a device that can approve a pairing request, we sometimes call it “old device”.
Sourcepub async fn approve_pairing(
&mut self,
request: impl IntoRequest<ApprovePairingRequest>,
) -> Result<Response<Empty>, Status>
pub async fn approve_pairing( &mut self, request: impl IntoRequest<ApprovePairingRequest>, ) -> Result<Response<Empty>, Status>
Approves a pairing request. The ApprovePairingRequest is forwarded to a signer for further processing.
Trait Implementations§
Source§impl<T: Clone> Clone for PairingClient<T>
impl<T: Clone> Clone for PairingClient<T>
Source§fn clone(&self) -> PairingClient<T>
fn clone(&self) -> PairingClient<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> !Freeze for PairingClient<T>
impl<T> RefUnwindSafe for PairingClient<T>where
T: RefUnwindSafe,
impl<T> Send for PairingClient<T>where
T: Send,
impl<T> Sync for PairingClient<T>where
T: Sync,
impl<T> Unpin for PairingClient<T>where
T: Unpin,
impl<T> UnwindSafe for PairingClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
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>
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>
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>
T in a tonic::Request