Struct ReadManaged
pub struct ReadManaged<S>where
S: AsFd,{ /* private fields */ }Expand description
A fused ReadManaged operation
Implementations§
§impl<S> ReadManaged<S>where
S: AsFd,
impl<S> ReadManaged<S>where
S: AsFd,
pub fn new(
fd: S,
pool: &BufferPool,
len: usize,
) -> Result<ReadManaged<S>, Error>
pub fn new( fd: S, pool: &BufferPool, len: usize, ) -> Result<ReadManaged<S>, Error>
Create a new ReadManaged.
Trait Implementations§
§impl<S> OpCode for ReadManaged<S>where
S: AsFd,
impl<S> OpCode for ReadManaged<S>where
S: AsFd,
§fn create_entry(self: Pin<&mut ReadManaged<S>>) -> OpEntry
fn create_entry(self: Pin<&mut ReadManaged<S>>) -> OpEntry
Create submission entry.
§fn call_blocking(self: Pin<&mut Self>) -> Result<usize, Error>
fn call_blocking(self: Pin<&mut Self>) -> Result<usize, Error>
Call the operation in a blocking way. This method will only be called if
create_entry returns OpEntry::Blocking.§unsafe fn set_result(self: Pin<&mut Self>, _: usize)
unsafe fn set_result(self: Pin<&mut Self>, _: usize)
Set the result when it successfully completes.
The operation stores the result and is responsible to release it if the
operation is cancelled. Read more
§impl<S> OpCode for ReadManaged<S>where
S: AsFd,
impl<S> OpCode for ReadManaged<S>where
S: AsFd,
§fn pre_submit(self: Pin<&mut ReadManaged<S>>) -> Result<Decision, Error>
fn pre_submit(self: Pin<&mut ReadManaged<S>>) -> Result<Decision, Error>
Perform the operation before submit, and return
Decision to
indicate whether submitting the operation to polling is required.§fn op_type(self: Pin<&mut ReadManaged<S>>) -> Option<OpType>
fn op_type(self: Pin<&mut ReadManaged<S>>) -> Option<OpType>
Get the operation type when an event is occurred.
§fn operate(self: Pin<&mut ReadManaged<S>>) -> Poll<Result<usize, Error>>
fn operate(self: Pin<&mut ReadManaged<S>>) -> Poll<Result<usize, Error>>
Perform the operation after received corresponding
event. If this operation is blocking, the return value should be
Poll::Ready.§impl<S> TakeBuffer for ReadManaged<S>where
S: AsFd,
impl<S> TakeBuffer for ReadManaged<S>where
S: AsFd,
§type BufferPool = BufferPool
type BufferPool = BufferPool
Buffer pool type.
§type Buffer<'a> = BorrowedBuffer<'a>
type Buffer<'a> = BorrowedBuffer<'a>
Selected buffer type. It keeps the reference to the buffer pool and
returns the buffer back on drop.
§fn take_buffer(
self,
buffer_pool: &<ReadManaged<S> as TakeBuffer>::BufferPool,
result: Result<usize, Error>,
buffer_id: u16,
) -> Result<<ReadManaged<S> as TakeBuffer>::Buffer<'_>, Error>
fn take_buffer( self, buffer_pool: &<ReadManaged<S> as TakeBuffer>::BufferPool, result: Result<usize, Error>, buffer_id: u16, ) -> Result<<ReadManaged<S> as TakeBuffer>::Buffer<'_>, Error>
Take the selected buffer with
buffer_pool, io result and
buffer_id, if io operation is success.Auto Trait Implementations§
impl<S> Freeze for ReadManaged<S>where
S: Freeze,
impl<S> !RefUnwindSafe for ReadManaged<S>
impl<S> !Send for ReadManaged<S>
impl<S> !Sync for ReadManaged<S>
impl<S> !Unpin for ReadManaged<S>
impl<S> !UnwindSafe for ReadManaged<S>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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