Skip to main content

ExitQueue

Struct ExitQueue 

Source
pub struct ExitQueue {
    entries: VecDeque<VmmExitEvent>,
    capacity: usize,
    dropped: u64,
}
Expand description

Bounded queue of exit events.

Fields§

§entries: VecDeque<VmmExitEvent>§capacity: usize§dropped: u64

Implementations§

Source§

impl ExitQueue

Source

pub fn new(capacity: usize) -> Self

Creates a queue with the given capacity (at least 1).

Source

pub const fn capacity(&self) -> usize

Capacity.

Source

pub fn len(&self) -> usize

Number of pending events.

Source

pub fn is_empty(&self) -> bool

True if the queue is empty.

Source

pub const fn dropped(&self) -> u64

Number of events refused since creation (diagnostics).

Source

pub fn push(&mut self, event: VmmExitEvent) -> Result<(), QueueError>

Adds an event. Returns Full if the queue is full; no data is silently overwritten.

Source

pub fn pop(&mut self) -> Result<VmmExitEvent, QueueError>

Removes the oldest event.

Source

pub fn peek(&self) -> Result<VmmExitEvent, QueueError>

Reads the oldest event without removing it (diagnostics only).

The queue is owned by the policy: a diagnostic reader must not consume an event behind its back.

Source

pub fn drain(&mut self) -> Vec<VmmExitEvent>

Empties the queue and returns the removed events.

Source

pub fn clear(&mut self)

Empties the queue.

Trait Implementations§

Source§

impl Debug for ExitQueue

Source§

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

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

impl Default for ExitQueue

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.