pub struct Reservation<'a> { /* private fields */ }Expand description
A wrapper around a slot of memory in the ring buffer.
A Reservation has a predetermined size that is determined by the size passed into reserve. Any
attempt to write more than this amount of data into the slot is a programming error and will
cause an assertion failure. This class provides a formal way for writers to serialize data in
place in the ring buffer, thus eliminating the need for a temporary serialization buffer.
Implementations§
Source§impl<'a> Reservation<'a>
impl<'a> Reservation<'a>
Sourcepub fn write(&mut self, data: &[u8]) -> Result<(), Status>
pub fn write(&mut self, data: &[u8]) -> Result<(), Status>
Writes the given data into this reservation.
Trait Implementations§
Source§impl<'a> Debug for Reservation<'a>
impl<'a> Debug for Reservation<'a>
Source§impl<'a> Drop for Reservation<'a>
impl<'a> Drop for Reservation<'a>
Auto Trait Implementations§
impl<'a> !UnwindSafe for Reservation<'a>
impl<'a> Freeze for Reservation<'a>
impl<'a> RefUnwindSafe for Reservation<'a>
impl<'a> Send for Reservation<'a>
impl<'a> Sync for Reservation<'a>
impl<'a> Unpin for Reservation<'a>
impl<'a> UnsafeUnpin for Reservation<'a>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more