pub struct LocklessRingBuffer { /* private fields */ }Implementations§
Source§impl LocklessRingBuffer
impl LocklessRingBuffer
pub const PAGE_HEADER_SIZE: usize = 16
Sourcepub fn new(
size_bytes: usize,
overwrite: bool,
write_event_async_id: Id,
) -> Result<Self, Errno>
pub fn new( size_bytes: usize, overwrite: bool, write_event_async_id: Id, ) -> Result<Self, Errno>
Creates a new LocklessRingBuffer. size_bytes: Size of the ring buffer. Must be at least PAGE_SIZE * 3 and will be rounded up to a multiple of PAGE_SIZE. overwrite: If true, old pages will be dropped when the ring is full. If false, writes will fail until the data is read. write_event_async_id: The async trace event ID for write events.
pub fn dropped_pages(&self) -> u64
Source§impl LocklessRingBuffer
impl LocklessRingBuffer
pub fn reserve( &self, size: usize, ) -> Result<(Reservation<'_>, BootInstant, Duration<BootTimeline>), Errno>
pub fn commit(&self, reservation: Reservation<'_>)
pub fn swap_reader_page(&self) -> Option<usize>
pub fn read(&self, buf: &mut dyn OutputBuffer) -> Result<usize, Errno>
pub fn is_enabled(&self) -> bool
pub fn disable(&self) -> Result<u64, Errno>
pub fn enable(&self) -> Result<BootInstant, Errno>
Trait Implementations§
Source§impl Drop for LocklessRingBuffer
impl Drop for LocklessRingBuffer
Auto Trait Implementations§
impl !Freeze for LocklessRingBuffer
impl !RefUnwindSafe for LocklessRingBuffer
impl Send for LocklessRingBuffer
impl Sync for LocklessRingBuffer
impl Unpin for LocklessRingBuffer
impl UnsafeUnpin for LocklessRingBuffer
impl UnwindSafe for LocklessRingBuffer
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [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>
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 moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.