Struct Extra
pub struct Extra(/* private fields */);Expand description
Platform-specific extra data associated with a driver instance.
It can be used to set options for or get extra data from I/O operations.
Implementations§
§impl Extra
impl Extra
pub fn with_personality(self, personality: u16) -> Extra
pub fn with_personality(self, personality: u16) -> Extra
Set the personality, returning the modified Extra.
This is a no-op when not using io_uring driver.
pub fn set_personality(&mut self, personality: u16)
pub fn set_personality(&mut self, personality: u16)
Set the personality for this operation.
This is a no-op when not using io_uring driver.
pub fn get_personality(&self) -> Option<u16>
pub fn get_personality(&self) -> Option<u16>
Get the personality for this operation.
If the personality was not set with set_personality or the platform
does not support it, returns None.
pub fn buffer_id(&self) -> Result<u16, Error>
pub fn buffer_id(&self) -> Result<u16, Error>
Try to get the buffer ID associated with this operation.
§Behavior
This is only supported on io_uring drivers, in which the driver will
try to extract buffer_id returned by the kernel as a part of flags.
If the id cannot be extracted from the flag, an InvalidInput
io::Error will be returned. On other platforms, this will always
return Ok(0).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Extra
impl RefUnwindSafe for Extra
impl Send for Extra
impl Sync for Extra
impl Unpin for Extra
impl UnwindSafe for Extra
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
§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>
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>
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