Struct cursive::utils::lines::spans::Segment [−][src]
Expand description
Refers to a part of a span
Fields
span_id: usize
ID of the span this segment refers to
start: usize
Beginning of this segment within the span (included)
end: usize
End of this segment within the span (excluded)
width: usize
Width of this segment
Implementations
Resolve this segment to a string slice and an attribute.
Resolves this segment to plain text.
pub fn source_indices<S>(&self, spans: &[S]) -> Option<(usize, usize)> where
S: AsRef<IndexedCow>,
pub fn source_indices<S>(&self, spans: &[S]) -> Option<(usize, usize)> where
S: AsRef<IndexedCow>,
Returns indices in the source string, if possible.
Returns (start, end)
, or None
if the target span is an owned string.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Segment
impl UnwindSafe for Segment
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
.