Struct dharitri_wasm::types::LockableStaticBuffer
source · pub struct LockableStaticBuffer {
pub buffer: [u8; 10000],
pub locked: bool,
pub used_size: usize,
}Fields§
§buffer: [u8; 10000]§locked: bool§used_size: usizeImplementations§
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 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§
Auto Trait Implementations§
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