pub struct Segment {
pub start: usize,
pub end: usize,
pub byte_start: usize,
pub byte_end: usize,
pub slots_before: usize,
}Expand description
One line’s char range [start, end) into the content, with the matching byte
range and the count of island slots before the line — so a caller indexes
the content text and the island list in O(1) without rescanning.
Fields§
§start: usizeUSV index of the line’s first char.
end: usizeUSV index one past the line’s last char (its \n, or the content end).
byte_start: usizeByte offset of start in the content text.
byte_end: usizeByte offset of end in the content text.
slots_before: usizeCount of ISLAND_SLOT chars before start.
Trait Implementations§
impl Copy for Segment
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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.