[−][src]Struct cursive::utils::span::SpannedStr
The immutable, borrowed equivalent of SpannedString
.
Implementations
impl<'a, T> SpannedStr<'a, T> where
T: 'a,
[src]
T: 'a,
pub fn new(source: &'a str, spans: &'a [IndexedSpan<T>]) -> SpannedStr<'a, T>
[src]
Creates a new SpannedStr
from the given references.
pub fn spans<'b>(&'b self) -> impl Iterator<Item = Span<'a, T>> + 'b where
'a: 'b,
[src]
'a: 'b,
Gives access to the parsed styled spans.
pub fn spans_raw(&self) -> &'a [IndexedSpan<T>]
[src]
Returns a reference to the indexed spans.
pub fn source(&self) -> &'a str
[src]
Returns a reference to the source (non-parsed) string.
pub fn is_empty(&self) -> bool
[src]
Returns true
if self
is empty.
Can be caused by an empty source, or no span.
Trait Implementations
impl<'a, T> Clone for SpannedStr<'a, T>
[src]
pub fn clone(&self) -> SpannedStr<'a, T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, T> Debug for SpannedStr<'a, T> where
T: Debug,
[src]
T: Debug,
impl<'a, T> Eq for SpannedStr<'a, T> where
T: Eq,
[src]
T: Eq,
impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>
[src]
pub fn from(other: &'a SpannedString<T>) -> SpannedStr<'a, T>
[src]
impl<'a, T> PartialEq<SpannedStr<'a, T>> for SpannedStr<'a, T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,
pub fn eq(&self, other: &SpannedStr<'a, T>) -> bool
[src]
pub fn ne(&self, other: &SpannedStr<'a, T>) -> bool
[src]
impl<'a, T> SpannedText for SpannedStr<'a, T> where
T: 'a,
[src]
T: 'a,
type S = IndexedSpan<T>
Type of span returned by SpannedText::spans()
.
pub fn source(&self) -> &str
[src]
pub fn spans(&self) -> &[IndexedSpan<T>]
[src]
pub fn as_ref(&self) -> SpannedTextRef<'_, Self>
[src]
impl<'a, T> StructuralEq for SpannedStr<'a, T>
[src]
impl<'a, T> StructuralPartialEq for SpannedStr<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for SpannedStr<'a, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<'a, T> Send for SpannedStr<'a, T> where
T: Sync,
[src]
T: Sync,
impl<'a, T> Sync for SpannedStr<'a, T> where
T: Sync,
[src]
T: Sync,
impl<'a, T> Unpin for SpannedStr<'a, T>
[src]
impl<'a, T> UnwindSafe for SpannedStr<'a, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.