pub struct StringBuilder {
pub codes: Vec<u16>,
}Expand description
builds a string from code units, strings and interned strings, then interns it: no string is created
Fields§
§codes: Vec<u16>Implementations§
Source§impl StringBuilder
impl StringBuilder
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn append_id(&mut self, table: &StringTable, id: u32) -> &mut Self
pub fn append_id(&mut self, table: &StringTable, id: u32) -> &mut Self
append the code units of an interned string
Sourcepub fn append_string(&mut self, str: &str) -> &mut Self
pub fn append_string(&mut self, str: &str) -> &mut Self
append a string
Sourcepub fn append_code(&mut self, code: u16) -> &mut Self
pub fn append_code(&mut self, code: u16) -> &mut Self
append a code unit
Sourcepub fn intern(&self, table: &mut StringTable) -> u32
pub fn intern(&self, table: &mut StringTable) -> u32
intern the string
Trait Implementations§
Auto Trait Implementations§
impl Forget for StringBuilder
impl Freeze for StringBuilder
impl Move for StringBuilder
impl RefUnwindSafe for StringBuilder
impl Send for StringBuilder
impl Sync for StringBuilder
impl Unpin for StringBuilder
impl UnsafeUnpin for StringBuilder
impl UnwindSafe for StringBuilder
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