pub struct CommandReplyBuilder { /* private fields */ }Expand description
Builder for constructing CommandReply instances using a fluent API.
request_id and response_to are required and must match the values
from the received CommandReceive.
Implementations§
Source§impl CommandReplyBuilder
impl CommandReplyBuilder
Sourcepub fn request_id(self, id: impl Into<String>) -> Self
pub fn request_id(self, id: impl Into<String>) -> Self
Set the request ID (required). Must match CommandReceive::id.
Sourcepub fn response_to(self, channel: impl Into<String>) -> Self
pub fn response_to(self, channel: impl Into<String>) -> Self
Set the reply channel (required). Must match CommandReceive::response_to.
Sourcepub fn metadata(self, metadata: impl Into<String>) -> Self
pub fn metadata(self, metadata: impl Into<String>) -> Self
Set optional UTF-8 metadata to include in the reply.
Sourcepub fn client_id(self, id: impl Into<String>) -> Self
pub fn client_id(self, id: impl Into<String>) -> Self
Override the client-level client_id for this reply.
Sourcepub fn executed_at(self, time: i64) -> Self
pub fn executed_at(self, time: i64) -> Self
Set the execution timestamp.
Sourcepub fn error(self, err: impl Into<String>) -> Self
pub fn error(self, err: impl Into<String>) -> Self
Report an error. Setting this marks the command as not executed.
Replace all tags with the provided map.
Sourcepub fn build(self) -> CommandReply
pub fn build(self) -> CommandReply
Consume the builder and return the constructed CommandReply.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandReplyBuilder
impl RefUnwindSafe for CommandReplyBuilder
impl Send for CommandReplyBuilder
impl Sync for CommandReplyBuilder
impl Unpin for CommandReplyBuilder
impl UnsafeUnpin for CommandReplyBuilder
impl UnwindSafe for CommandReplyBuilder
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request