vmbus_ring

Struct IncomingRing

Source
pub struct IncomingRing<M: RingMem> { /* private fields */ }
Expand description

The interface to the receiving endpoint of a ring buffer.

Implementations§

Source§

impl<M: RingMem> IncomingRing<M>

Source

pub fn new(mem: M) -> Result<Self, Error>

Returns a new incoming ring. Fails if the ring memory is not sized or aligned correctly or if the ring control data is corrupt.

Source

pub fn supports_pending_send_size(&self) -> bool

Indicates whether pending send size notification is supported on the vmbus ring.

Source

pub fn set_interrupt_mask(&self, state: bool)

Enables or disables the interrupt mask, declaring to the opposite endpoint that interrupts should not or should be sent for a ring empty-to-non-empty transition.

Source

pub fn verify_interrupts_unmasked(&self) -> Result<(), Error>

Verifies that interrupts are currently unmasked.

This can be used to check that ring state is consistent.

Source

pub fn incoming(&self) -> Result<IncomingOffset, Error>

Returns the current incoming offset, for passing to read and commit_read.

Source

pub fn can_read(&self, incoming: &mut IncomingOffset) -> Result<bool, Error>

Returns true if there are any packets to read.

Source

pub fn commit_read(&self, ptrs: &mut IncomingOffset) -> bool

Commits a series of packet reads, returning whether the opposite endpoint should be signaled.

Source

pub fn read( &self, ptrs: &mut IncomingOffset, ) -> Result<IncomingPacket, ReadError>

Parses the next packet descriptor, returning the parsed information and a range that can be used to read the packet. The caller should commit the read with commit_read to free up space in the ring.

Trait Implementations§

Source§

impl<M: Debug + RingMem> Debug for IncomingRing<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M: RingMem> Inspect for IncomingRing<M>

Source§

fn inspect(&self, req: Request<'_>)

Inspects the object.
Source§

impl<M: RingMem> Ring for IncomingRing<M>

Source§

type Memory = M

The underlying memory type.
Source§

fn mem(&self) -> &Self::Memory

The backing memory of the ring buffer.

Auto Trait Implementations§

§

impl<M> Freeze for IncomingRing<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for IncomingRing<M>
where M: RefUnwindSafe,

§

impl<M> Send for IncomingRing<M>

§

impl<M> Sync for IncomingRing<M>
where M: Sync,

§

impl<M> Unpin for IncomingRing<M>
where M: Unpin,

§

impl<M> UnwindSafe for IncomingRing<M>
where M: 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more