Enum viceroy_lib::session::AsyncItem
source · pub enum AsyncItem {
Body(Body),
StreamingBody(StreamingBody),
PendingReq(PeekableTask<Response<Body>>),
PendingKvLookup(PendingKvLookupTask),
PendingKvInsert(PendingKvInsertTask),
PendingKvDelete(PendingKvDeleteTask),
}
Expand description
Represents either a full body, or the write end of a streaming body.
This enum is needed because we reuse the handle for a body when it is transformed into a streaming
body (writeable only). It is used within the body handle map in Session
.
Variants§
Body(Body)
StreamingBody(StreamingBody)
PendingReq(PeekableTask<Response<Body>>)
PendingKvLookup(PendingKvLookupTask)
PendingKvInsert(PendingKvInsertTask)
PendingKvDelete(PendingKvDeleteTask)
Implementations§
source§impl AsyncItem
impl AsyncItem
pub fn is_streaming(&self) -> bool
pub fn as_body(&self) -> Option<&Body>
pub fn as_body_mut(&mut self) -> Option<&mut Body>
pub fn into_body(self) -> Option<Body>
pub fn as_streaming_mut(&mut self) -> Option<&mut StreamingBody>
pub fn into_streaming(self) -> Option<StreamingBody>
pub fn begin_streaming(&mut self) -> Option<Body>
pub fn as_pending_kv_lookup(&self) -> Option<&PendingKvLookupTask>
pub fn into_pending_kv_lookup(self) -> Option<PendingKvLookupTask>
pub fn as_pending_kv_insert(&self) -> Option<&PendingKvInsertTask>
pub fn into_pending_kv_insert(self) -> Option<PendingKvInsertTask>
pub fn as_pending_kv_delete(&self) -> Option<&PendingKvDeleteTask>
pub fn into_pending_kv_delete(self) -> Option<PendingKvDeleteTask>
pub fn as_pending_req(&self) -> Option<&PeekableTask<Response<Body>>>
pub fn as_pending_req_mut( &mut self ) -> Option<&mut PeekableTask<Response<Body>>>
pub fn into_pending_req(self) -> Option<PeekableTask<Response<Body>>>
pub async fn await_ready(&mut self)
pub fn is_ready(&mut self) -> bool
Trait Implementations§
source§impl From<PendingKvDeleteTask> for AsyncItem
impl From<PendingKvDeleteTask> for AsyncItem
source§fn from(task: PendingKvDeleteTask) -> Self
fn from(task: PendingKvDeleteTask) -> Self
Converts to this type from the input type.
source§impl From<PendingKvInsertTask> for AsyncItem
impl From<PendingKvInsertTask> for AsyncItem
source§fn from(task: PendingKvInsertTask) -> Self
fn from(task: PendingKvInsertTask) -> Self
Converts to this type from the input type.
source§impl From<PendingKvLookupTask> for AsyncItem
impl From<PendingKvLookupTask> for AsyncItem
source§fn from(task: PendingKvLookupTask) -> Self
fn from(task: PendingKvLookupTask) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AsyncItem
impl !RefUnwindSafe for AsyncItem
impl Send for AsyncItem
impl Sync for AsyncItem
impl Unpin for AsyncItem
impl !UnwindSafe for AsyncItem
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self
file descriptor. Read more