pub struct WriteOnce<'a, S: Storage + ?Sized> { /* private fields */ }
Expand description
Only allows a single write into the storage. After that, no more writes are allowed.
This can be used for very low latency scenarios where processing the single read is more important than filling the entire storage with as much data as possible.
Implementations§
Trait Implementations§
Source§impl<S: Storage + ?Sized> Storage for WriteOnce<'_, S>
impl<S: Storage + ?Sized> Storage for WriteOnce<'_, S>
const SPECIALIZES_BYTES: bool = S::SPECIALIZES_BYTES
const SPECIALIZES_BYTES_MUT: bool = S::SPECIALIZES_BYTES_MUT
Source§fn put_uninit_slice<F, Error>(
&mut self,
payload_len: usize,
f: F,
) -> Result<bool, Error>
fn put_uninit_slice<F, Error>( &mut self, payload_len: usize, f: F, ) -> Result<bool, Error>
Tries to write into a uninit slice for the current storage Read more
Source§fn remaining_capacity(&self) -> usize
fn remaining_capacity(&self) -> usize
Returns the additional number of bytes that can be written to the storage
Source§fn has_remaining_capacity(&self) -> bool
fn has_remaining_capacity(&self) -> bool
Returns
true
if the storage will accept any additional bytesSource§fn with_write_limit(&mut self, max_len: usize) -> Limit<'_, Self>
fn with_write_limit(&mut self, max_len: usize) -> Limit<'_, Self>
Limits the number of bytes that can be written to the storage
Source§fn track_write(&mut self) -> Tracked<'_, Self>
fn track_write(&mut self) -> Tracked<'_, Self>
Tracks the number of bytes written to the storage
Source§fn write_once(&mut self) -> WriteOnce<'_, Self>
fn write_once(&mut self) -> WriteOnce<'_, Self>
Only allows a single write into the storage. After that, no more writes are allowed. Read more
Auto Trait Implementations§
impl<'a, S> Freeze for WriteOnce<'a, S>where
S: ?Sized,
impl<'a, S> RefUnwindSafe for WriteOnce<'a, S>where
S: RefUnwindSafe + ?Sized,
impl<'a, S> Send for WriteOnce<'a, S>
impl<'a, S> Sync for WriteOnce<'a, S>
impl<'a, S> Unpin for WriteOnce<'a, S>where
S: ?Sized,
impl<'a, S> !UnwindSafe for WriteOnce<'a, S>
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