pub struct StringTable { /* private fields */ }Expand description
A table of strings that will be stored in a .debug_str section.
Implementations§
Source§impl StringTable
impl StringTable
Sourcepub fn add<T>(&mut self, bytes: T) -> StringId
pub fn add<T>(&mut self, bytes: T) -> StringId
Add a string to the string table and return its id.
If the string already exists, then return the id of the existing string.
§Panics
Panics if bytes contains a null byte.
Sourcepub fn offset(&self, id: StringId) -> DebugStrOffset
pub fn offset(&self, id: StringId) -> DebugStrOffset
Trait Implementations§
Source§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