pub struct TextBuf { /* private fields */ }Implementations§
Source§impl TextBuf
impl TextBuf
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the TextBuf and returns the inner String.
Sourcepub fn from_string(s: String) -> Result<Self, InvalidTextError>
pub fn from_string(s: String) -> Result<Self, InvalidTextError>
Creates a TextBuf from a String, validating the text invariant.
Sourcepub unsafe fn from_string_unchecked(s: String) -> Self
pub unsafe fn from_string_unchecked(s: String) -> Self
Creates a TextBuf from a String without checking the text invariant.
§Safety
The string must not contain ASCII control characters other than HTAB or LF.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextBuf
impl RefUnwindSafe for TextBuf
impl Send for TextBuf
impl Sync for TextBuf
impl Unpin for TextBuf
impl UnsafeUnpin for TextBuf
impl UnwindSafe for TextBuf
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