pub struct LockableStaticBuffer {
pub buffer: [u8; 10000],
pub locked: bool,
pub used_size: usize,
}
Fields§
§buffer: [u8; 10000]
§locked: bool
§used_size: usize
Implementations§
Source§impl LockableStaticBuffer
impl LockableStaticBuffer
pub const fn new() -> Self
pub const fn new_locked() -> Self
Sourcepub fn try_lock_with_copy_bytes<F: FnOnce(&mut [u8])>(
&mut self,
len: usize,
copy_bytes: F,
) -> bool
pub fn try_lock_with_copy_bytes<F: FnOnce(&mut [u8])>( &mut self, len: usize, copy_bytes: F, ) -> bool
Returns true if locked successfully.
pub fn unlock(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub const fn capacity() -> usize
pub fn remaining_capacity(&self) -> usize
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
pub fn load_slice( &self, starting_position: usize, dest: &mut [u8], ) -> Result<(), InvalidSliceError>
pub fn try_extend_from_slice(&mut self, bytes: &[u8]) -> bool
pub fn try_extend_from_copy_bytes<F: FnOnce(&mut [u8])>( &mut self, len: usize, copy_bytes: F, ) -> bool
Trait Implementations§
Source§impl Debug for LockableStaticBuffer
impl Debug for LockableStaticBuffer
Auto Trait Implementations§
impl Freeze for LockableStaticBuffer
impl RefUnwindSafe for LockableStaticBuffer
impl Send for LockableStaticBuffer
impl Sync for LockableStaticBuffer
impl Unpin for LockableStaticBuffer
impl UnwindSafe for LockableStaticBuffer
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