pub struct RequestProcess { /* private fields */ }Expand description
Object connected to the ClientMainTask and containing a request expecting an answer.
If this object is dropped before the request has been answered, an automatic “internal error” error response is automatically sent back.
Implementations§
Source§impl RequestProcess
impl RequestProcess
Sourcepub fn request(&self) -> MethodCall<'_>
pub fn request(&self) -> MethodCall<'_>
Returns the request which must be processed.
The request is guaranteed to not be related to subscriptions in any way.
Sourcepub fn respond(self, response: Response<'_>)
pub fn respond(self, response: Response<'_>)
Indicate the response to the request to the ClientMainTask.
Has no effect if the ClientMainTask has been destroyed.
Sourcepub fn respond_null(self)
pub fn respond_null(self)
Indicate to the ClientMainTask that the response to the request is null.
Has no effect if the ClientMainTask has been destroyed.
Sourcepub fn fail(self, error: ErrorResponse<'_>)
pub fn fail(self, error: ErrorResponse<'_>)
Indicate to the ClientMainTask that the request should return an error.
Has no effect if the ClientMainTask has been destroyed.
Sourcepub fn fail_with_attached_json(self, error: ErrorResponse<'_>, json: &str)
pub fn fail_with_attached_json(self, error: ErrorResponse<'_>, json: &str)
Indicate to the ClientMainTask that the request should return an error.
This function is similar to RequestProcess, except that an additional JSON payload is
attached to the error.
Has no effect if the ClientMainTask has been destroyed.
Trait Implementations§
Source§impl Debug for RequestProcess
impl Debug for RequestProcess
Auto Trait Implementations§
impl Freeze for RequestProcess
impl RefUnwindSafe for RequestProcess
impl Send for RequestProcess
impl Sync for RequestProcess
impl Unpin for RequestProcess
impl UnwindSafe for RequestProcess
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more