pub enum ResponseStatus<T = ()> {
Done(T),
SendNext,
Continue,
}
Expand description
Successful return type from send descriptor handler method that indicates what should happen next.
Variants§
Done(T)
Emit the given value.
SendNext
Allocate a new Message ID, resend a new request, and wait for the associated response.
This is used when handling block requests to fetch additional blocks, among other cases.
Continue
Wait for additional responses to the original request without sending new requests.
This is used when handling multicast requests and observing.
Implementations§
Source§impl<T> ResponseStatus<T>
impl<T> ResponseStatus<T>
Sourcepub fn done(self) -> Option<T>
pub fn done(self) -> Option<T>
If the response status is Done(value)
, returns Some(value)
, otherwise returns None
.
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Returns true if the response status is Done(...)
, false otherwise.
Sourcepub fn is_send_next(&self) -> bool
pub fn is_send_next(&self) -> bool
Returns true if the response status is SendNext
, false otherwise.
Sourcepub fn is_continue(&self) -> bool
pub fn is_continue(&self) -> bool
Returns true if the response status is Continue
, false otherwise.
Sourcepub fn as_ref(&self) -> ResponseStatus<&T>
pub fn as_ref(&self) -> ResponseStatus<&T>
Converts the contained type to be a reference, so that Done(T)
becomes Done(&T)
.
Sourcepub fn as_mut(&mut self) -> ResponseStatus<&mut T>
pub fn as_mut(&mut self) -> ResponseStatus<&mut T>
Converts the contained type to be a mutable reference, so that Done(T)
becomes
Done(&mut T)
.
Trait Implementations§
Source§impl<T: Clone> Clone for ResponseStatus<T>
impl<T: Clone> Clone for ResponseStatus<T>
Source§fn clone(&self) -> ResponseStatus<T>
fn clone(&self) -> ResponseStatus<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more