Skip to main content

RingScope

Struct RingScope 

Source
pub struct RingScope<'delivery, T = (), X = ()> { /* private fields */ }
Expand description

Exclusive access to an EventDelivery’s ring, narrowed to what a submitting caller needs (M18.6).

Held for as long as the value lives, so keep it to the shortest scope that covers a submission: the wait callback needs the same lock to deliver completions.

See EventDelivery::scope for what this deliberately does not expose, and why handing out anything that yields a &mut IoRing would reopen D-43.

Implementations§

Source§

impl<T, X> RingScope<'_, T, X>

Source

pub fn batch(&mut self) -> Batch<'_, T, X>

Open a Batch against the ring.

The borrow is confined to the returned batch, so no &mut IoRing escapes to the caller.

Source

pub fn outstanding(&self) -> usize

Operations submitted but not yet popped, as IoRing::outstanding.

Source

pub fn version(&self) -> RingVersion

This ring’s negotiated version, as IoRing::version.

Source

pub fn info(&self) -> Result<RingInfo>

Query the ring, as IoRing::info.

§Errors

As IoRing::info.

Source

pub fn supports(&self, op: Op) -> bool

Whether this ring supports op, as IoRing::supports.

Source

pub fn supports_raw(&self, op_code: IORING_OP_CODE) -> bool

Whether this ring supports op_code, as IoRing::supports_raw.

Source

pub fn registered_file_count(&self) -> u32

Registered file count, as IoRing::registered_file_count.

Source

pub fn registered_buffer_count(&self) -> u32

Registered buffer count, as IoRing::registered_buffer_count.

Auto Trait Implementations§

§

impl<'delivery, T = (), X = ()> !Send for RingScope<'delivery, T, X>

§

impl<'delivery, T = (), X = ()> !Sync for RingScope<'delivery, T, X>

§

impl<'delivery, T, X> Freeze for RingScope<'delivery, T, X>
where MutexGuard<'delivery, IoRing<T, X>>: Freeze,

§

impl<'delivery, T, X> RefUnwindSafe for RingScope<'delivery, T, X>
where MutexGuard<'delivery, IoRing<T, X>>: RefUnwindSafe,

§

impl<'delivery, T, X> Unpin for RingScope<'delivery, T, X>
where MutexGuard<'delivery, IoRing<T, X>>: Unpin,

§

impl<'delivery, T, X> UnsafeUnpin for RingScope<'delivery, T, X>
where MutexGuard<'delivery, IoRing<T, X>>: UnsafeUnpin,

§

impl<'delivery, T, X> UnwindSafe for RingScope<'delivery, T, X>
where MutexGuard<'delivery, IoRing<T, X>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.