pub struct StringTable { /* private fields */ }Expand description
The one table of strings a module’s sections refer to by index (load-module.md §4.2).
Implementations§
Source§impl StringTable
impl StringTable
pub fn get(&self, index: usize) -> Option<&str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &str>
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
The STRINGS section body: a count, then each string’s byte length and UTF-8 bytes.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, ModuleError>
pub fn decode(bytes: &[u8]) -> Result<Self, ModuleError>
Refuses invalid UTF-8, a text stored twice, and bytes after the last string.
Trait Implementations§
Source§impl Clone for StringTable
impl Clone for StringTable
Source§impl Debug for StringTable
impl Debug for StringTable
Source§impl Default for StringTable
impl Default for StringTable
impl Eq for StringTable
Source§impl PartialEq for StringTable
impl PartialEq for StringTable
impl StructuralPartialEq for StringTable
Auto Trait Implementations§
impl Freeze for StringTable
impl RefUnwindSafe for StringTable
impl Send for StringTable
impl Sync for StringTable
impl Unpin for StringTable
impl UnsafeUnpin for StringTable
impl UnwindSafe for StringTable
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