Struct ReadManaged
pub struct ReadManaged<S> { /* private fields */ }Expand description
Read a file into managed buffer.
Implementations§
§impl<S> ReadManaged<S>
impl<S> ReadManaged<S>
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 ReadManaged.
Trait Implementations§
§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>
impl<S> TakeBuffer for ReadManaged<S>
§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.
§type BufferPool = BufferPool
type BufferPool = BufferPool
Buffer pool type.
§fn take_buffer(
self,
buffer_pool: &<ReadManaged<S> as TakeBuffer>::BufferPool,
result: Result<usize, Error>,
_: u16,
) -> Result<<ReadManaged<S> as TakeBuffer>::Buffer<'_>, Error>
fn take_buffer( self, buffer_pool: &<ReadManaged<S> as TakeBuffer>::BufferPool, result: Result<usize, Error>, _: 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.impl<'__pin, S> Unpin for ReadManaged<S>where
<PinnedFieldsOfHelperStruct<__Origin<'__pin, S>> as PinnedFieldsOfHelperTrait>::Actual: Unpin,
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> !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