pub struct ThrowErrorRequest<T: ThrowErrorRequestState> { /* private fields */ }Expand description
Implementations§
Source§impl ThrowErrorRequest<Initial>
impl ThrowErrorRequest<Initial>
Sourcepub fn with_job_key(self, job_key: i64) -> ThrowErrorRequest<WithKey>
pub fn with_job_key(self, job_key: i64) -> ThrowErrorRequest<WithKey>
Source§impl ThrowErrorRequest<WithKey>
impl ThrowErrorRequest<WithKey>
Sourcepub fn with_error_code(self, error_code: String) -> ThrowErrorRequest<WithCode>
pub fn with_error_code(self, error_code: String) -> ThrowErrorRequest<WithCode>
Source§impl ThrowErrorRequest<WithCode>
impl ThrowErrorRequest<WithCode>
Sourcepub fn with_error_message(self, error_message: String) -> Self
pub fn with_error_message(self, error_message: String) -> Self
Sourcepub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
pub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
Sets variables that will be available in the error catch event scope
§Arguments
data- Variables as serializable type that will be converted to JSON JSON document that will instantiate the variables at the local scope of the error catch event that catches the thrown error; it must be a JSON object, as variables will be mapped in a key-value fashion. e.g. { “a”: 1, “b”: 2 } will create two variables, named “a” and “b” respectively, with their associated values. [{ “a”: 1, “b”: 2 }] would not be a valid argument, as the root of the JSON document is an array and not an object.
§Errors
Returns ClientError if serialization fails
§Returns
A Result containing the updated ThrowErrorRequest with the variables set, or a ClientError
Sourcepub async fn send(self) -> Result<ThrowErrorResponse, ClientError>
pub async fn send(self) -> Result<ThrowErrorResponse, ClientError>
Trait Implementations§
Source§impl<T: Clone + ThrowErrorRequestState> Clone for ThrowErrorRequest<T>
impl<T: Clone + ThrowErrorRequestState> Clone for ThrowErrorRequest<T>
Source§fn clone(&self) -> ThrowErrorRequest<T>
fn clone(&self) -> ThrowErrorRequest<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for ThrowErrorRequest<T>
impl<T> !RefUnwindSafe for ThrowErrorRequest<T>
impl<T> Send for ThrowErrorRequest<T>where
T: Send,
impl<T> Sync for ThrowErrorRequest<T>where
T: Sync,
impl<T> Unpin for ThrowErrorRequest<T>where
T: Unpin,
impl<T> !UnwindSafe for ThrowErrorRequest<T>
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> 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>
Wrap the input message
T in a tonic::Request