Struct cursive::utils::span::SpannedStr [−][src]
pub struct SpannedStr<'a, T> where
T: 'a, { /* fields omitted */ }
The immutable, borrowed equivalent of SpannedString
.
Methods
impl<'a, T> SpannedStr<'a, T> where
T: 'a,
[src]
impl<'a, T> SpannedStr<'a, T> where
T: 'a,
pub fn new(source: &'a str, spans: &'a [IndexedSpan<T>]) -> Self
[src]
pub fn new(source: &'a str, spans: &'a [IndexedSpan<T>]) -> Self
Creates a new SpannedStr
from the given references.
pub fn spans(&self) -> Vec<Span<'a, T>>
[src]
pub fn spans(&self) -> Vec<Span<'a, T>>
Gives access to the parsed styled spans.
pub fn spans_raw(&self) -> &'a [IndexedSpan<T>]
[src]
pub fn spans_raw(&self) -> &'a [IndexedSpan<T>]
Returns a reference to the indexed spans.
pub fn source(&self) -> &'a str
[src]
pub fn source(&self) -> &'a str
Returns a reference to the source (non-parsed) string.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true
if self
is empty.
Can be caused by an empty source, or no span.
Trait Implementations
impl<'a, T: Debug> Debug for SpannedStr<'a, T> where
T: 'a,
[src]
impl<'a, T: Debug> Debug for SpannedStr<'a, T> where
T: 'a,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, T: PartialEq> PartialEq for SpannedStr<'a, T> where
T: 'a,
[src]
impl<'a, T: PartialEq> PartialEq for SpannedStr<'a, T> where
T: 'a,
fn eq(&self, other: &SpannedStr<'a, T>) -> bool
[src]
fn eq(&self, other: &SpannedStr<'a, T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SpannedStr<'a, T>) -> bool
[src]
fn ne(&self, other: &SpannedStr<'a, T>) -> bool
This method tests for !=
.
impl<'a, T: Eq> Eq for SpannedStr<'a, T> where
T: 'a,
[src]
impl<'a, T: Eq> Eq for SpannedStr<'a, T> where
T: 'a,
impl<'a, T> SpannedText for SpannedStr<'a, T> where
T: 'a,
[src]
impl<'a, T> SpannedText for SpannedStr<'a, T> where
T: 'a,
type S = IndexedSpan<T>
Type of span returned by SpannedText::spans()
.
fn source(&self) -> &str
[src]
fn source(&self) -> &str
Returns the source text.
fn spans(&self) -> &[IndexedSpan<T>]
[src]
fn spans(&self) -> &[IndexedSpan<T>]
Returns the spans for this text.
fn as_ref<'a>(&'a self) -> SpannedTextRef<'a, Self>
[src]
fn as_ref<'a>(&'a self) -> SpannedTextRef<'a, Self>
Returns a SpannedText
by reference.
impl<'a, T> Clone for SpannedStr<'a, T>
[src]
impl<'a, T> Clone for SpannedStr<'a, T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>
[src]
impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>
fn from(other: &'a SpannedString<T>) -> Self
[src]
fn from(other: &'a SpannedString<T>) -> Self
Performs the conversion.
Auto Trait Implementations
impl<'a, T> Send for SpannedStr<'a, T> where
T: Sync,
impl<'a, T> Send for SpannedStr<'a, T> where
T: Sync,
impl<'a, T> Sync for SpannedStr<'a, T> where
T: Sync,
impl<'a, T> Sync for SpannedStr<'a, T> where
T: Sync,