pub struct SSlice<T> { /* private fields */ }Expand description
A smart-pointer for stable memory.
Implementations
sourceimpl SSlice<StableMemoryAllocator>
impl SSlice<StableMemoryAllocator>
pub fn set_custom_data_ptr(&mut self, idx: usize, ptr: u64)
pub fn get_custom_data_ptr(&mut self, idx: usize) -> u64
sourceimpl<T> SSlice<T>
impl<T> SSlice<T>
pub fn get_size_bytes(&self) -> usize
pub fn get_total_size_bytes(&self) -> usize
pub fn _write_bytes(&self, offset: usize, data: &[u8])
pub fn _write_word(&self, offset: usize, word: u64)
pub fn _read_bytes(&self, offset: usize, data: &mut [u8])
pub fn _read_word(&self, offset: usize) -> u64
pub unsafe fn clone(&self) -> Self
Trait Implementations
sourceimpl<'a, T, C: Context> Readable<'a, C> for SSlice<T>
impl<'a, T, C: Context> Readable<'a, C> for SSlice<T>
fn read_from<R: Reader<'a, C>>(
reader: &mut R
) -> Result<Self, <C as Context>::Error>
fn minimum_bytes_needed() -> usize
fn read_from_buffer_with_ctx(
context: C,
buffer: &'a [u8]
) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_with_ctx(
context: C,
buffer: &'a [u8]
) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_buffer_copying_data_with_ctx(
context: C,
buffer: &[u8]
) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_copying_data_with_ctx(
context: C,
buffer: &[u8]
) -> (Result<Self, <C as Context>::Error>, usize)
fn read_with_length_from_buffer_copying_data_with_ctx_mut(
context: &mut C,
buffer: &[u8]
) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_stream_unbuffered_with_ctx<S>(
context: C,
stream: S
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_stream_buffered_with_ctx<S>(
context: C,
stream: S
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_file_with_ctx(
context: C,
path: impl AsRef<Path>
) -> Result<Self, <C as Context>::Error>
sourceimpl<T, C: Context> Writable<C> for SSlice<T>
impl<T, C: Context> Writable<C> for SSlice<T>
fn write_to<W: ?Sized + Writer<C>>(
&self,
writer: &mut W
) -> Result<(), <C as Context>::Error>
fn write_to_buffer_with_ctx(
&self,
context: C,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error>
fn write_to_buffer_with_ctx_mut(
&self,
context: &mut C,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error>
fn write_to_vec_with_ctx(
&self,
context: C
) -> Result<Vec<u8, Global>, <C as Context>::Error>
fn write_to_vec_with_ctx_mut(
&self,
context: &mut C
) -> Result<Vec<u8, Global>, <C as Context>::Error>
fn write_to_stream_with_ctx<S>(
&self,
context: C,
stream: S
) -> Result<(), <C as Context>::Error>where
S: Write,
fn write_to_file_with_ctx(
&self,
context: C,
path: impl AsRef<Path>
) -> Result<(), <C as Context>::Error>
fn bytes_needed(&self) -> Result<usize, <C as Context>::Error>
Auto Trait Implementations
impl<T> RefUnwindSafe for SSlice<T>where
T: RefUnwindSafe,
impl<T> Send for SSlice<T>where
T: Send,
impl<T> Sync for SSlice<T>where
T: Sync,
impl<T> Unpin for SSlice<T>where
T: Unpin,
impl<T> UnwindSafe for SSlice<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more