pub struct Rope { /* private fields */ }Expand description
A rope data structure for efficient large string construction.
A rope is a binary tree of string slices that supports O(log n)
concatenation. Flattening to a String is O(n).
Implementations§
Source§impl Rope
impl Rope
Sourcepub fn append_str(self, s: &str) -> Rope
pub fn append_str(self, s: &str) -> Rope
Append a string slice to the rope.
Sourcepub fn collect_string(&self) -> String
pub fn collect_string(&self) -> String
Flatten the rope into a String.
Note: This uses the Display implementation which performs
the same in-order traversal of the rope tree.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rope
impl RefUnwindSafe for Rope
impl Send for Rope
impl Sync for Rope
impl Unpin for Rope
impl UnsafeUnpin for Rope
impl UnwindSafe for Rope
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