pub struct BodySpans {
pub code: Vec<Range<usize>>,
pub links: Vec<Range<usize>>,
pub images: Vec<Range<usize>>,
}Expand description
What one parse of a body yields for a link scan: the spans twig reads as code, the spans it reads as inline links, and the spans it reads as images, each sorted by start offset.
A named struct rather than a bare tuple because the lists are the same shape, and telling them apart at a call site should not depend on getting their order right.
Fields§
§code: Vec<Range<usize>>Everything a link scan must treat as opaque — see code_spans.
links: Vec<Range<usize>>Each inline [label](target) construct — see link_spans.
images: Vec<Range<usize>>Each  construct, the leading ! included. twig parses an
image as its own node kind, not as a link, so a scan that collected only
Self::links never saw one — and a move rewrote every link in a page’s
body while leaving its pictures pointing at the old directory.
Trait Implementations§
impl Eq for BodySpans
impl StructuralPartialEq for BodySpans
Auto Trait Implementations§
impl Freeze for BodySpans
impl RefUnwindSafe for BodySpans
impl Send for BodySpans
impl Sync for BodySpans
impl Unpin for BodySpans
impl UnsafeUnpin for BodySpans
impl UnwindSafe for BodySpans
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.