Struct aldrin::FunctionCallReply
source · pub struct FunctionCallReply { /* private fields */ }
Expand description
Helper used to reply to a pending service function call.
Every FunctionCall
contains a FunctionCallReply
. It can be used once to set the return
value of the function call.
When FunctionCallReply
is dropped (as opposed to consumed by one of its methods),
abort
will be called implicitly.
Implementations§
source§impl FunctionCallReply
impl FunctionCallReply
sourcepub fn set<T, E>(self, res: Result<&T, &E>) -> Result<(), Error>
pub fn set<T, E>(self, res: Result<&T, &E>) -> Result<(), Error>
Sets the function call’s reply.
sourcepub fn ok<T: Serialize + ?Sized>(self, value: &T) -> Result<(), Error>
pub fn ok<T: Serialize + ?Sized>(self, value: &T) -> Result<(), Error>
Signals that the function call was successful.
sourcepub fn err<T: Serialize + ?Sized>(self, value: &T) -> Result<(), Error>
pub fn err<T: Serialize + ?Sized>(self, value: &T) -> Result<(), Error>
Signals that the function call has failed.
sourcepub fn abort(self) -> Result<(), Error>
pub fn abort(self) -> Result<(), Error>
Aborts the function call.
The caller will be still be notified that the call was aborted.
sourcepub fn invalid_function(self) -> Result<(), Error>
pub fn invalid_function(self) -> Result<(), Error>
Signals that an invalid function has been called.
The function, as identified by FunctionCall::id
, may be invalid or unexpected by the
service.
sourcepub fn invalid_args(self) -> Result<(), Error>
pub fn invalid_args(self) -> Result<(), Error>
Signals that invalid arguments were passed to the function.
Trait Implementations§
source§impl Debug for FunctionCallReply
impl Debug for FunctionCallReply
Auto Trait Implementations§
impl Freeze for FunctionCallReply
impl !RefUnwindSafe for FunctionCallReply
impl Send for FunctionCallReply
impl Sync for FunctionCallReply
impl Unpin for FunctionCallReply
impl !UnwindSafe for FunctionCallReply
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