pub struct RefPoint {
pub kind: RefKind,
pub labels: Vec<Label>,
pub computed: usize,
pub malformed: Vec<MalformedLabel>,
pub anchor: AnchorPolicy,
pub number: Option<NumberSource>,
pub content: Option<ContentRef>,
pub accepts: AcceptedRefTypes,
}Expand description
A reference point: one place in a document that can be referred to, numbered, or given an anchor, such as a heading, an equation line, a theorem or a footnote.
An element declares the reference points of each occurrence through the
Referenceable aspect, and the refpoints feature records them for every
tree (REFPOINTS). A node
carries zero or more points: a display-math environment has one point per
equation line, a heading has one, and an element that nothing can point at
does not declare the aspect. A point is identified by a PointId. See
reference points, labels and
anchors.
§What a reference to the point shows
A point gives the two things it may show, and a reference shows the first of these that exists: the point’s number, shown in the counter style of its number source, when the numbering gave it one in this document; otherwise its content, such as a heading’s title; otherwise the label the reference was written with, as written.
A point gives both because a point with a number source may still get no
number in a run (no numbering feature registered, a counter that no feature
declares, an enclosing counter with no value) and must then have something
else to show. The point’s element decides whether the point has a number
source, from its feature’s configuration fixed when the registry was
built, and every point that has one is numbered where possible. What a
reference shows is therefore decided by the target; the reference site
decides only how it is presented (RefDisplayOptions).
Fields§
§kind: RefKindThe reference kind: what sort of thing the point is, such as
section, equation or theorem. The set of kinds is open: a feature
uses the kinds it needs.
labels: Vec<Label>The labels of this point: first the computed
ones, which the element computed, then the labels written for the point
in the document, in the order they were written.
computed: usizeThe number of the point’s computed labels: the first computed
labels were computed by the element, not written by the
author, and the accepted label types (accepts) do not
apply to them. 0 for a point whose labels are all written, which is
every point except one whose element derives labels from the document,
as a term definition (the defterm environment) does from its term.
malformed: Vec<MalformedLabel>The texts written as labels for this point that are not of the form
type:label, in the order they were written, each with its
position among the point’s labels. They
define nothing; the refs feature reports each one.
anchor: AnchorPolicyHow the point’s anchor, the identifier a link points at, is formed.
number: Option<NumberSource>What the point is numbered by, or None for a point that carries no
number. See NumberSource and what a reference to the point
shows.
content: Option<ContentRef>The content a reference shows when the point has no number, such as a
heading’s title, the text of an explicit tag or the bullet beside a
list’s item: a reference into the frozen tree, or a tree the aspect
built when no node holds the content by itself
(ContentRef::Synthesized). None for a point with no content to
show.
accepts: AcceptedRefTypesThe label types that may be written for this point. A written label of
another type defines nothing and is reported; see AcceptedRefTypes.
The check applies to what the author wrote only: the first
computed labels are not checked.
Trait Implementations§
impl Eq for RefPoint
impl StructuralPartialEq for RefPoint
Auto Trait Implementations§
impl !RefUnwindSafe for RefPoint
impl !UnwindSafe for RefPoint
impl Forget for RefPoint
impl Freeze for RefPointwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Label>: Freeze,
PhantomData<MalformedLabel>: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<NodeTree<Flm>> is !null: Freeze,
PhantomData<ArcInner<NodeTree<Flm>>>: Freeze,
PhantomData<NodeId>: Freeze,
PhantomData<u32>: Freeze,
PhantomData<String>: Freeze,
impl Move for RefPoint
impl Send for RefPoint
impl Sync for RefPoint
impl Unpin for RefPoint
impl UnsafeUnpin for RefPointwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Label>: UnsafeUnpin,
PhantomData<MalformedLabel>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<NodeTree<Flm>> is !null: UnsafeUnpin,
PhantomData<ArcInner<NodeTree<Flm>>>: UnsafeUnpin,
PhantomData<NodeId>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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