pub struct CommandServiceClient<T> { /* private fields */ }Expand description
Commands, sent by clients and by handlers of listeners.
Implementations§
Source§impl<T> CommandServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> CommandServiceClient<T>where
T: GrpcService<Body>,
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,
) -> CommandServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::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 submit(
&mut self,
request: impl IntoRequest<SubmitRequest>,
) -> Result<Response<CommandResult>, Status>
pub async fn submit( &mut self, request: impl IntoRequest<SubmitRequest>, ) -> Result<Response<CommandResult>, Status>
Submits a command and waits as wait says. Needs submit for the qualified command type,
and a worker that registered it (or a membership that lists its aggregate), otherwise
NOT_FOUND. Middlewares before the command may reject it; the outcome is then rejected.
A command ID that was submitted before is not run again: Submit returns its stored result,
or waits for it. If the command does not complete within the kernel’s submit timeout,
Submit fails with DEADLINE_EXCEEDED, but the command stays queued: resubmit it to get the
result. Other errors: UNAUTHENTICATED (missing or invalid signature), PERMISSION_DENIED,
INVALID_ARGUMENT, FAILED_PRECONDITION (see listener; vault values without a vault),
UNAVAILABLE (a middleware is not connected, or the kernel shuts down), DEADLINE_EXCEEDED
(a middleware did not answer in time).
Sourcepub async fn cancel(
&mut self,
request: impl IntoRequest<CancelRequest>,
) -> Result<Response<CancelResult>, Status>
pub async fn cancel( &mut self, request: impl IntoRequest<CancelRequest>, ) -> Result<Response<CancelResult>, Status>
Cancels a scheduled command (Command.deliver_at) before it is due: the command completes
as rejected cancelled, so its ID answers that from then on. Needs submit for the
command’s type; middlewares check it as a cancel of that type (MiddlewareCall.cancel), and
may reject it. A command that is due already, running or completed answers too_late; an
unknown ID not_found.
Trait Implementations§
Source§impl<T: Clone> Clone for CommandServiceClient<T>
impl<T: Clone> Clone for CommandServiceClient<T>
Auto Trait Implementations§
impl<T> !Freeze for CommandServiceClient<T>
impl<T> Forget for CommandServiceClient<T>
impl<T> Move for CommandServiceClient<T>
impl<T> RefUnwindSafe for CommandServiceClient<T>where
Grpc<T>: RefUnwindSafe,
impl<T> Send for CommandServiceClient<T>
impl<T> Sync for CommandServiceClient<T>
impl<T> Unpin for CommandServiceClient<T>
impl<T> UnsafeUnpin for CommandServiceClient<T>where
Grpc<T>: UnsafeUnpin,
impl<T> UnwindSafe for CommandServiceClient<T>where
Grpc<T>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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