Struct parsec_client::core::operation_client::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: RequestClientClient for request and response objects
Implementations
sourceimpl OperationClient
impl OperationClient
sourcepub fn new() -> Result<OperationClient>
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.
sourcepub fn process_operation(
&self,
operation: NativeOperation,
provider: ProviderId,
auth: &Authentication
) -> Result<NativeResult>
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
sourceimpl Debug for OperationClient
impl Debug for OperationClient
Auto Trait Implementations
impl !RefUnwindSafe for OperationClient
impl Send for OperationClient
impl Sync for OperationClient
impl Unpin for OperationClient
impl !UnwindSafe for OperationClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more