pub struct StringTable { /* private fields */ }Expand description
String table for deduplicated string storage
Implementations§
Source§impl StringTable
impl StringTable
pub fn new() -> Self
Sourcepub fn add(&mut self, s: &str) -> u32
pub fn add(&mut self, s: &str) -> u32
Add a string to the table, return its offset If string already exists, returns existing offset
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Deserialize from bytes
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl Clone for StringTable
impl Clone for StringTable
Source§fn clone(&self) -> StringTable
fn clone(&self) -> StringTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringTable
impl Debug for StringTable
Source§impl Default for StringTable
impl Default for StringTable
Source§fn default() -> StringTable
fn default() -> StringTable
Returns the “default value” for a type. Read more
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