pub struct ExitQueue {
entries: VecDeque<VmmExitEvent>,
capacity: usize,
dropped: u64,
}Expand description
Bounded queue of exit events.
Fields§
§entries: VecDeque<VmmExitEvent>§capacity: usize§dropped: u64Implementations§
Source§impl ExitQueue
impl ExitQueue
Sourcepub fn push(&mut self, event: VmmExitEvent) -> Result<(), QueueError>
pub fn push(&mut self, event: VmmExitEvent) -> Result<(), QueueError>
Adds an event. Returns Full if the queue is full; no
data is silently overwritten.
Sourcepub fn pop(&mut self) -> Result<VmmExitEvent, QueueError>
pub fn pop(&mut self) -> Result<VmmExitEvent, QueueError>
Removes the oldest event.
Sourcepub fn peek(&self) -> Result<VmmExitEvent, QueueError>
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.
Sourcepub fn drain(&mut self) -> Vec<VmmExitEvent>
pub fn drain(&mut self) -> Vec<VmmExitEvent>
Empties the queue and returns the removed events.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ExitQueue
impl Freeze for ExitQueue
impl Move for ExitQueue
impl RefUnwindSafe for ExitQueue
impl Send for ExitQueue
impl Sync for ExitQueue
impl Unpin for ExitQueue
impl UnsafeUnpin for ExitQueue
impl UnwindSafe for ExitQueue
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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 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> ⓘ
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