Trait MemoryStringExt

Source
pub trait MemoryStringExt: MemoryRefLoad {
    // Provided methods
    fn load_cstr(&self, offset: usize, len: usize) -> Result<&CStr> { ... }
    fn load_cstr_until_nul(
        &self,
        offset: usize,
        max_len: usize,
    ) -> Result<&CStr> { ... }
    fn load_string(&self, offset: usize, len: usize) -> Result<String> { ... }
    fn load_cstring(&self, offset: usize, len: usize) -> Result<CString> { ... }
    fn load_cstring_until_nul(
        &self,
        offset: usize,
        max_len: usize,
    ) -> Result<CString> { ... }
    fn load_js_string(&self, offset: usize, len: usize) -> Result<String> { ... }
}
Expand description

Convenience methods for loading strings from memory

Provided Methods§

Source

fn load_cstr(&self, offset: usize, len: usize) -> Result<&CStr>

Load a C-style string from memory

Source

fn load_cstr_until_nul(&self, offset: usize, max_len: usize) -> Result<&CStr>

Load a C-style string from memory, stopping at the first nul byte

Source

fn load_string(&self, offset: usize, len: usize) -> Result<String>

Load a UTF-8 string from memory

Source

fn load_cstring(&self, offset: usize, len: usize) -> Result<CString>

Load a C-style string from memory

Source

fn load_cstring_until_nul( &self, offset: usize, max_len: usize, ) -> Result<CString>

Load a C-style string from memory, stopping at the first nul byte

Source

fn load_js_string(&self, offset: usize, len: usize) -> Result<String>

Load a JavaScript-style utf-16 string from memory

Implementors§