pub struct Text(/* private fields */);Implementations§
Source§impl Text
impl Text
pub fn with_style(style: Style) -> Text
pub fn new() -> Text
pub fn push_str(&mut self, s: impl AsRef<str>) -> Result<(), NewlineError>
pub fn push_string(&mut self, s: String) -> Result<(), NewlineError>
pub fn current_span_mut(&mut self) -> &mut Span<'static>
pub fn set_style(&mut self, style: Style)
pub fn new_span(&mut self, style: Style)
Sourcepub fn extend(&mut self, other: &mut Text)
pub fn extend(&mut self, other: &mut Text)
Extend self with more text. Styles are patched along the way.
pub fn spans(&self) -> &Vec<Span<'static>>
pub fn complete(self, line: Line) -> Line
Sourcepub fn swap_complete(&mut self, line: Line) -> Line
pub fn swap_complete(&mut self, line: Line) -> Line
Replace self with a new Text which picks up where the provided line
appended to the current text leaves off stylistically.
pub fn empty(&self) -> bool
pub fn style(&self) -> Style
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more