Struct cursive::utils::span::SpannedString [−][src]
pub struct SpannedString<T> { /* fields omitted */ }
Expand description
A string with associated spans.
Each span has an associated attribute T
.
Implementations
Returns a plain StyledString without any style.
You got no style, Dutch. You know that.
Creates a new StyledString
using a single style for the entire text.
Appends the given plain text to self
.
Returns an empty SpannedString
.
pub fn with_spans<S>(
source: S,
spans: Vec<IndexedSpan<T>, Global>
) -> SpannedString<T> where
S: Into<String>,
pub fn with_spans<S>(
source: S,
spans: Vec<IndexedSpan<T>, Global>
) -> SpannedString<T> where
S: Into<String>,
Creates a new SpannedString
manually.
It is not recommended to use this directly.
Instead, look for methods like Markdown::parse
.
Shrink the source to discard any unused prefix.
Returns a new SpannedString with a single span.
Appends the given StyledString
to self
.
Appends content
and its corresponding spans to the end.
It is not recommended to use this directly;
instead, look at the append
method.
Remove the given range of spans from the styled string.
You may want to follow this with either compact()
,
trim_start()
or trim_end()
.
Iterates on the resolved spans.
Iterates on the resolved spans, with mutable access to the attributes.
Returns a reference to the indexed spans.
Returns a mutable iterator on the spans of this string.
This can be used to modify the style of each span.
Returns a reference to the source string.
This is the non-parsed string.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
pub fn from_iter<I>(iter: I) -> SpannedString<T> where
I: IntoIterator<Item = SpannedString<T>>,
pub fn from_iter<I>(iter: I) -> SpannedString<T> where
I: IntoIterator<Item = SpannedString<T>>,
Creates a value from an iterator. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type S = IndexedSpan<T>
type S = IndexedSpan<T>
Type of span returned by SpannedText::spans()
.
Returns the spans for this text.
Returns a SpannedText
by reference.
Auto Trait Implementations
impl<T> RefUnwindSafe for SpannedString<T> where
T: RefUnwindSafe,
impl<T> Send for SpannedString<T> where
T: Send,
impl<T> Sync for SpannedString<T> where
T: Sync,
impl<T> Unpin for SpannedString<T> where
T: Unpin,
impl<T> UnwindSafe for SpannedString<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Calls the given closure and return the result. Read more
Calls the given closure on self
.