pub struct HeadingElement {
pub decl: HeadingDecl,
pub commands: Vec<HeadingCommand>,
pub numbered: bool,
}Expand description
The data of the element value of one heading kind (see the element). It contains the declaration of the heading kind, its heading commands, and whether the heading kind is numbered.
All heading commands of a heading kind share one element value. A lowering
rule obtains the HeadingElement of a heading with element_value.
HeadingElement also implements the Sectioning and Referenceable
aspects of the element value.
Fields§
§decl: HeadingDeclThe declaration of the heading kind.
commands: Vec<HeadingCommand>The heading commands of the heading kind, in the order of
HeadingsConfig::commands.
numbered: boolWhether the heading kind is numbered under the configuration of the
headings feature (HeadingsConfig::numbers).
Implementations§
Source§impl HeadingElement
impl HeadingElement
Sourcepub fn command_of(&self, node: &NodeRef<'_, Flm>) -> Option<&HeadingCommand>
pub fn command_of(&self, node: &NodeRef<'_, Flm>) -> Option<&HeadingCommand>
Returns the heading command with which the heading node is written.
Returns None if the node has no name, for instance a heading that a
program created, or if no heading command of this heading kind has the
name of the node.
Sourcepub fn occurrence(&self, node: &NodeRef<'_, Flm>) -> HeadingOccurrence
pub fn occurrence(&self, node: &NodeRef<'_, Flm>) -> HeadingOccurrence
Returns the options of the heading node. This method calls
heading_options with the heading command of the node
(command_of).
Trait Implementations§
Source§impl Clone for HeadingElement
impl Clone for HeadingElement
Source§impl Debug for HeadingElement
impl Debug for HeadingElement
impl Eq for HeadingElement
Source§impl PartialEq for HeadingElement
impl PartialEq for HeadingElement
Source§impl Referenceable for HeadingElement
impl Referenceable for HeadingElement
Source§impl Sectioning for HeadingElement
impl Sectioning for HeadingElement
Source§fn toc_title(&self, node: &NodeRef<'_, Flm>) -> Option<ContentRef>
fn toc_title(&self, node: &NodeRef<'_, Flm>) -> Option<ContentRef>
Returns the alternative title of the heading (heading_alt) if the
heading has one, and the title argument otherwise.
The alternative title is copied into a synthesized value, as content
that is displayed a second time (ValueContent::Shown). For instance,
a footnote in the alternative title is copied as its mark only. Returns
None if the copy fails, which happens only for content nested deeper
than the recursion guard allows. No diagnostic is
reported in this case.
impl StructuralPartialEq for HeadingElement
Auto Trait Implementations§
impl Forget for HeadingElement
impl Freeze for HeadingElementwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Name>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<HeadingCommand>: Freeze,
impl Move for HeadingElement
impl RefUnwindSafe for HeadingElement
impl Send for HeadingElement
impl Sync for HeadingElement
impl Unpin for HeadingElement
impl UnsafeUnpin for HeadingElementwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Name>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<HeadingCommand>: UnsafeUnpin,
impl UnwindSafe for HeadingElement
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