Struct OperationClient

Source
pub struct OperationClient {
    pub content_converter: Box<dyn Convert + Send + Sync>,
    pub accept_converter: Box<dyn Convert + Send + Sync>,
    pub request_client: RequestClient,
}
Expand description

Low-level client optimised for communicating with the Parsec service at an operation level.

Usage is recommended when fine control over how operations are wrapped and processed is needed.

Fields§

§content_converter: Box<dyn Convert + Send + Sync>

Converter that manages request body conversions

Defaults to a Protobuf converter

§accept_converter: Box<dyn Convert + Send + Sync>

Converter that manages response body conversions

Defaults to a Protobuf converter

§request_client: RequestClient

Client for request and response objects

Implementations§

Source§

impl OperationClient

Source

pub fn new() -> Result<OperationClient>

Creates an OperationClient instance. The request client uses a timeout of 5 seconds on reads and writes on the socket. It uses the version 1.0 wire protocol to form requests, the direct authentication method and protobuf format as content type.

Source

pub fn process_operation( &self, operation: NativeOperation, provider: ProviderId, auth: &Authentication, ) -> Result<NativeResult>

Send an operation to a specific provider and get a result.

§Errors

If the conversions between operation to request or between response to result fail, returns a serializing or deserializing error. Returns an error if the operation itself failed. If the opcode is different between request and response, InvalidServiceResponseType is returned.

Trait Implementations§

Source§

impl Debug for OperationClient

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for OperationClient

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,