pub struct Span {
pub start: usize,
pub end: usize,
pub style: StyleType,
}Expand description
Fields§
§start: usize§end: usize§style: StyleTypeImplementations§
Source§impl Span
impl Span
Sourcepub fn new(start: usize, end: usize, style: impl Into<StyleType>) -> Self
pub fn new(start: usize, end: usize, style: impl Into<StyleType>) -> Self
A span of style over [start, end).
Sourcepub fn split(&self, offset: usize) -> (Span, Option<Span>)
pub fn split(&self, offset: usize) -> (Span, Option<Span>)
Split at offset, when it falls inside the span. Port of
Span.split.
Sourcepub fn right_crop(&self, offset: usize) -> Span
pub fn right_crop(&self, offset: usize) -> Span
The span cropped to end at offset. Port of Span.right_crop.
Trait Implementations§
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.