[−][src]Struct cursive_core::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>]) -> Self[src]
Creates a new SpannedStr from the given references.
pub fn spans<'b>(
&'b self
) -> impl DoubleEndedIterator<Item = Span<'a, T>> + ExactSizeIterator<Item = Span<'a, T>> + 'b where
'a: 'b, [src]
&'b self
) -> impl DoubleEndedIterator<Item = Span<'a, T>> + ExactSizeIterator<Item = Span<'a, T>> + 'b where
'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) -> Self[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a, T: Debug> Debug for SpannedStr<'a, T>[src]
impl<'a, T: Eq> Eq for SpannedStr<'a, T>[src]
impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>[src]
pub fn from(other: &'a SpannedString<T>) -> Self[src]
impl<'a, T: Hash> Hash for SpannedStr<'a, T>[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'a, T: PartialEq> PartialEq<SpannedStr<'a, T>> for SpannedStr<'a, T>[src]
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> CallHasher for T where
T: Hash + ?Sized, [src]
T: Hash + ?Sized,
impl<T> Erased for T[src]
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>,