pub struct Anchors {
pub ids: BTreeMap<PointId, Option<String>>,
}Expand description
The anchors table, flm.anchors (ANCHORS): every reference point of
the document with the anchor the anchors stage (ANCHORS_STAGE)
computed for it, or no
anchor when the point has nothing to form one from (no label it keeps,
under a policy that needs one) or when an earlier point already holds the
same one.
A point that the table does not hold at all is a point the stage never
saw, which is a different case: a consumer that finds one is reading data
that was never computed for the content it is looking at, and reports it
as such rather than treating the point as one without an anchor.
Anchors::lookup tells the two cases apart.
Fields§
§ids: BTreeMap<PointId, Option<String>>From a point to its anchor; None for a point that received none.
Implementations§
Source§impl Anchors
impl Anchors
Sourcepub fn id(&self, point: PointId) -> Option<&str>
pub fn id(&self, point: PointId) -> Option<&str>
The anchor of a point: None both for a point the stage never saw and
for one that received no anchor. A consumer that must tell the two
apart calls Anchors::lookup.
Sourcepub fn lookup(&self, point: PointId) -> Option<Option<&str>>
pub fn lookup(&self, point: PointId) -> Option<Option<&str>>
What the table holds for a point: None when the stage never saw the
point, Some(None) when it saw it and gave it no anchor (no label to
form it from, or a collision with an earlier point), and
Some(Some(id)) when it gave it the anchor id.
Trait Implementations§
Source§impl SingletonTable for Anchors
impl SingletonTable for Anchors
Source§impl Table for Anchors
impl Table for Anchors
Source§fn project(&self, cx: &dyn ProjectCx) -> SerialValue
fn project(&self, cx: &dyn ProjectCx) -> SerialValue
crate::dump) and tests. Read moreSource§fn piece_class(&self) -> PieceClass
fn piece_class(&self) -> PieceClass
Auto Trait Implementations§
impl Forget for Anchors
impl Freeze for Anchors
impl Move for Anchors
impl RefUnwindSafe for Anchors
impl Send for Anchors
impl Sync for Anchors
impl Unpin for Anchors
impl UnsafeUnpin for Anchors
impl UnwindSafe for Anchors
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more