pub struct Landing {
pub start: usize,
pub end: usize,
}Expand description
Where a locator lands — the answer to Doc::locate.
A locator (the v2 of a chapter.dj#v2) names a place rather than a
document, and a place is a span rather than a point: a reader following one
wants the caret at its first byte, and a reader merely peeking at one wants
the block it covers drawn. Both are served by carrying the whole span, and
only one of the two can be recovered from an offset alone.
Fields§
§start: usizeThe first byte of the block the locator names — where a caret goes.
end: usizeOne past its last byte, so a frontend can map the pair through
[Doc::pos_for_offset] to the rendered rows the block occupies and draw
those, the way a footnote peek draws a note (FootnoteRef::end).
Trait Implementations§
impl Eq for Landing
impl StructuralPartialEq for Landing
Auto Trait Implementations§
impl Freeze for Landing
impl RefUnwindSafe for Landing
impl Send for Landing
impl Sync for Landing
impl Unpin for Landing
impl UnsafeUnpin for Landing
impl UnwindSafe for Landing
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