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§
Source§impl Extra
impl Extra
Sourcepub fn is_notification(&self) -> Result<bool, Error>
pub fn is_notification(&self) -> Result<bool, Error>
Checks whether this completion reports a notification (2nd CQE returned for a zerocopy op).
§Behaviour
This is only supported on io_uring drivers, in which the driver will
check whether the IORING_CQE_F_NOTIF flag was set by the kernel for
the CQE. On other platforms, this will always return the
Unsupported error.
Sourcepub 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 Unsupported error.
Sourcepub fn get_personality(&self) -> Result<Option<u16>, Error>
pub fn get_personality(&self) -> Result<Option<u16>, Error>
Get the personality for this operation.
§Behavior
- If the driver is not
io_uring, returnUnsupportederror, - If the personality was not set with
set_personality, returnOk(None) - Otherwise, return
Ok(Some(personality))
Sourcepub fn sock_nonempty(&self) -> Result<bool, Error>
pub fn sock_nonempty(&self) -> Result<bool, Error>
Checks whether the underlying socket has more data to be read.
§Behaviour
This method must be used only on the flags for any of the receive
variants supported by IO_URING. The driver will try to check whether
the IORING_CQE_F_SOCK_NONEMPTY flag was set by the kernel for the CQE.
On other platforms, this will always return the Unsupported error.
Sourcepub fn set_drain(&mut self)
pub fn set_drain(&mut self)
Set the IOSQE_IO_DRAIN flag for this operation.
This ensures that this operation won’t start until all previously submitted operations complete.
See io_uring_sqe_set_flags(3) for more details.
This is a no-op when not using io_uring driver.
Sourcepub fn with_drain(self) -> Extra
pub fn with_drain(self) -> Extra
Call set_drain and return the modified Extra.
Sourcepub fn set_link(&mut self)
pub fn set_link(&mut self)
Set the IOSQE_IO_LINK flag for this operation.
This links this operation with the next one. The next operation will not start until this operation completed successfully.
See io_uring_sqe_set_flags(3) for more details.
This is a no-op when not using io_uring driver.
Sourcepub fn set_hardlink(&mut self)
pub fn set_hardlink(&mut self)
Set the IOSQE_IO_HARDLINK flag for this operation.
Like link, but the next operation will execute regardless of this operation’s result.
See io_uring_sqe_set_flags(3) for more details.
This is a no-op when not using io_uring driver.
Sourcepub fn with_hardlink(self) -> Extra
pub fn with_hardlink(self) -> Extra
Call set_hardlink and return the modified Extra.
Sourcepub fn set_personality(&mut self, personality: u16)
pub fn set_personality(&mut self, personality: u16)
Set the personality for this operation.
A personality represents a set of credentials (uid, gid, etc.) that will be used for this operation.
The personality can be retrieved with Proactor::register_personality.
This is a no-op when not using io_uring driver.
Sourcepub fn with_personality(self, personality: u16) -> Extra
pub fn with_personality(self, personality: u16) -> Extra
Call set_personality and return the modified Extra.
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 UnsafeUnpin 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