Struct jupiter::commands::Call [−][src]
Represents the invocation of a command.
This wraps the request, a pre-initialized result and the command index (token) in a single struct which is then sent to the actor executing the command using a queue. It also contains the callback which is another (oneshot) queue to send back the result - however this is completely handled internally, therefore only complete has to be called for this call to finish processing a command.
Fields
request: RequestContains the request as sent by the client.
response: ResponseContains the response to be filled with the response data
token: usizeContains the index of the commend being called.
This is required as commonly a bunch of commands share a single queue, so that the invocation of these commands is “single threaded” from the view of the actor.
Implementations
impl Call[src]
pub fn complete(self, result: CommandResult)[src]
Marks the command represented by this call as handled.
In case of a successful completion, this simply closes the response and sends the serialized data back to the caller. In case of an error, an appropriate representation is generated and sent back as alternative response. However, in case of an OutputError, we directly send error back to the caller, as the connection might be in an inconsistent state. The caller then will most probably try to write an error and then close the connection to prevent any further inconsistencies.
pub fn handle_unknown_token(self)[src]
Handles an unknown token by completing with an appropriate error.
Auto Trait Implementations
impl !RefUnwindSafe for Call
impl Send for Call
impl Sync for Call
impl Unpin for Call
impl !UnwindSafe for Call
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,