pub struct EcmaStringBuilder(/* private fields */);Expand description
The owned accumulation path for exact ECMAScript strings.
Implementations§
Source§impl EcmaStringBuilder
impl EcmaStringBuilder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty builder with room for capacity code units.
Sourcepub fn push_utf8(&mut self, value: &str)
pub fn push_utf8(&mut self, value: &str)
Encodes and appends a UTF-8 string as UTF-16 code units.
Sourcepub fn push_code_point(
&mut self,
code_point: u32,
) -> Result<(), InvalidCodePoint>
pub fn push_code_point( &mut self, code_point: u32, ) -> Result<(), InvalidCodePoint>
Appends one Unicode code point as UTF-16 code units.
Values in the BMP, including surrogate values, append one code unit; supplementary scalar values append a surrogate pair.
§Errors
Returns InvalidCodePoint for values greater than U+10FFFF rather
than truncating them to a u16.
Sourcepub fn finish(self) -> EcmaString
pub fn finish(self) -> EcmaString
Finishes this builder into an immutable string.
Trait Implementations§
Source§impl Default for EcmaStringBuilder
impl Default for EcmaStringBuilder
Source§fn default() -> EcmaStringBuilder
fn default() -> EcmaStringBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EcmaStringBuilder
impl RefUnwindSafe for EcmaStringBuilder
impl Send for EcmaStringBuilder
impl Sync for EcmaStringBuilder
impl Unpin for EcmaStringBuilder
impl UnsafeUnpin for EcmaStringBuilder
impl UnwindSafe for EcmaStringBuilder
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