pub struct Anchor {
pub char_range: Option<(usize, usize)>,
pub quote: Option<String>,
pub prefix: Option<String>,
pub suffix: Option<String>,
pub sentence_id: Option<String>,
pub source_version: Option<String>,
pub status: AnchorStatus,
}Expand description
Multi-selector anchor. Any field may be None; the resolver falls
through: position → quote + context → sentence id → orphan.
Fields§
§char_range: Option<(usize, usize)>TextPositionSelector: fast, fragile. (start, end) in chars.
quote: Option<String>TextQuoteSelector body.
prefix: Option<String>Context before the quote — used for disambiguation.
suffix: Option<String>Context after the quote.
sentence_id: Option<String>SHA1 of the normalized sentence containing the quote.
source_version: Option<String>Which paper-text extraction version this was anchored against.
status: AnchorStatusLast-known resolution status; updated on open.
Implementations§
Source§impl Anchor
impl Anchor
Sourcepub fn is_imported_synthetic(&self) -> bool
pub fn is_imported_synthetic(&self) -> bool
True when the anchor’s only “selector” is a synthetic
import-marker sentence_id (no quote, no char_range, no
real sentence hash) — i.e. a note= from a .bib import
that has nothing to anchor against in the paper text yet.
The resolver short-circuits these so they don’t trip the
orphan-warning UI flow (#158).
Sourcepub fn is_paper_note(&self) -> bool
pub fn is_paper_note(&self) -> bool
True when this anchor represents a paper-level note: a
commentary on the publication as a whole rather than a
passage in it. Built by paper_note_sentence_id(paper_id)
and recognised by the resolver as AnchorStatus::Ok without
needing a quote / char_range / fuzzy match. The TUI renders
these in a separate “paper-level notes” section above the
thread list. (#185)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Anchor
impl<'de> Deserialize<'de> for Anchor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl Freeze for Anchor
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnsafeUnpin for Anchor
impl UnwindSafe for Anchor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.