Skip to main content

ItemElement

Struct ItemElement 

Source
pub struct ItemElement { /* private fields */ }
Expand description

The data of the ITEM element, and its Referenceable aspect, which declares the reference point of the item an \item begins.

It holds the templates the feature compiled when the registry was built. For an untagged item of an unnumbered list that writes no usable label of its own, the reference point carries as its content the list kind’s fixed label template for the depth (the bullet), as the tree compiled once for that template.

Trait Implementations§

Source§

impl Clone for ItemElement

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ItemElement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Referenceable for ItemElement

Declares one reference point per \item that begins an item of a list, and none for any other \item. The point’s labels are the \label fields written after the \item, of the label type item; its anchor is derived from its first label or, for an unlabeled item, from its position.

An untagged item of a numbered list kind declares a number source (NumberSource): the list kind’s counter; the scoped instances under which it is counted (below), outermost first; the counter style of its list’s depth, whose number format is the depth’s reference template; the advance of level 0 by one; and, as the number template, the list’s own reference template where the list writes one (ListOptions::ref_template). The item’s counter value is therefore recorded in the form a reference to it shows, and the list’s rule writes the label beside the item from the same record.

§The content the reference point carries

A reference to an item shows what is shown beside the item, so the point carries the item’s label as its content wherever the label is not a number:

  • for a tagged item, its tag, however it is written (\item[Custom], \item[tag=Custom], \item[tag={Custom}]); such an item declares no number source, so it is counted in no counter;
  • for an untagged item of an unnumbered list, the list’s own label where its bracket writes one that can be used ([-], [label=*], [label={--}]), and otherwise the label template its list kind declares for the depth, by default the bullet • of an itemize. A list’s own label that holds a placeholder (label=#{arabic}, [1.]) is an error on an unnumbered list (LabelNamesNumber); the item shows the depth’s label instead, and a reference to the item shows the same;
  • for any other item, nothing: its number is what a reference shows.

This content is not a node of the document that the point could refer to (a bullet comes from the configuration, and Custom in tag=Custom shares a run of characters with its key), so the point carries it as a small tree of its own (ContentRef::Synthesized). The bullet’s tree is built once per configured template, when the registry is built, and shared by every item that shows it. A tag or a list’s own label is copied into a new tree each time the points are computed, which the refpoints feature does once per run.

§The scoped instances under which an item is counted

Each list is a scoped instance of its list kind’s counter (see scoped instances), and a nested list’s instance is numbered within the number of the item that holds it. A tagged item has no number, so no list can be numbered within it. An item is therefore counted under its own list and, among the enclosing lists of the same list kind, under each one whose item holding the nested list is untagged. A list held by a tagged item, or written before the first \item of the enclosing list, is numbered within the nearest untagged item of its list kind further out; where there is none, it is an outermost instance. The nesting depth, which selects the counter style, still counts every enclosing list of the list kind. In an enumerate, \item[T] \begin{enumerate}\item x\end{enumerate} therefore numbers x as (i) regardless of the items before T, and no nesting joiner writes a number of the enclosing list.

Source§

fn points(&self, node: &NodeRef<'_, Flm>) -> Vec<RefPoint>

The reference points of this occurrence, in document order. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ItemElement

§

impl !UnwindSafe for ItemElement

§

impl Forget for ItemElement

§

impl Freeze for ItemElement
where *const ArcInner<Labels> is !null: Freeze, PhantomData<ArcInner<Labels>>: Freeze,

§

impl Move for ItemElement

§

impl Send for ItemElement
where Arc<Labels>: Send,

§

impl Sync for ItemElement
where Arc<Labels>: Sync,

§

impl Unpin for ItemElement
where Arc<Labels>: Unpin,

§

impl UnsafeUnpin for ItemElement
where *const ArcInner<Labels> is !null: UnsafeUnpin, PhantomData<ArcInner<Labels>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.