pub struct CheetahBuilder { /* private fields */ }Expand description
Append-heavy builder for constructing Cheetah string values.
CheetahBuilder keeps mutable construction separate from immutable,
clone-cheap CheetahString values.
Implementations§
Source§impl CheetahBuilder
impl CheetahBuilder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty builder with at least capacity bytes.
Sourcepub fn from_string(value: String) -> Self
pub fn from_string(value: String) -> Self
Creates a builder from existing owned storage.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more bytes.
Sourcepub fn finish(self) -> CheetahString
pub fn finish(self) -> CheetahString
Freezes this builder into the canonical clone-cheap string value.
Use CheetahBuilder::into_string when construction is followed by
more mutation or when spare capacity must be retained.
Sourcepub fn finish_string(self) -> CheetahString
👎Deprecated since 3.0.0: use finish()
pub fn finish_string(self) -> CheetahString
use finish()
Freezes the builder into the canonical clone-cheap string value.
This compatibility name is retained so downstream v2 consumers can adopt the immutable v3 core without a source migration.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the owned String backing this builder.
Trait Implementations§
Source§impl Clone for CheetahBuilder
impl Clone for CheetahBuilder
Source§fn clone(&self) -> CheetahBuilder
fn clone(&self) -> CheetahBuilder
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 CheetahBuilder
impl Debug for CheetahBuilder
Source§impl Default for CheetahBuilder
impl Default for CheetahBuilder
Source§fn default() -> CheetahBuilder
fn default() -> CheetahBuilder
Returns the “default value” for a type. Read more
Source§impl<'a> Extend<&'a str> for CheetahBuilder
impl<'a> Extend<&'a str> for CheetahBuilder
Source§fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl Extend<char> for CheetahBuilder
impl Extend<char> for CheetahBuilder
Source§fn extend<T: IntoIterator<Item = char>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = char>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<&str> for CheetahBuilder
impl From<&str> for CheetahBuilder
Auto Trait Implementations§
impl Freeze for CheetahBuilder
impl RefUnwindSafe for CheetahBuilder
impl Send for CheetahBuilder
impl Sync for CheetahBuilder
impl Unpin for CheetahBuilder
impl UnsafeUnpin for CheetahBuilder
impl UnwindSafe for CheetahBuilder
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