[][src]Struct parsec_client::core::operation_client::OperationClient

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

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

impl OperationClient[src]

pub fn new() -> OperationClient[src]

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.

pub fn process_operation(
    &self,
    operation: NativeOperation,
    provider: ProviderID,
    auth: &Authentication
) -> Result<NativeResult>
[src]

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

impl Debug for OperationClient[src]

impl Default for OperationClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.