pub struct RecomposedDefinition {
pub name: String,
pub source_name: String,
pub text: String,
pub robust: bool,
pub feature: Option<String>,
pub declaration: bool,
}Expand description
One user definition on its way into a style file: the name it is defined under, the name the document declared, and the LaTeX text.
A kept user definition is recomposed under a name of its own
(recomposed_name), so the two names
usually differ; the style file’s comment line above the definition gives
both, so that an author reading the file recognizes their own definition.
Where the document declared one name twice, once for text mode and once for
mathematics mode (per-mode definitions), the file holds two definitions
whose source_name is the same authored name; the
comment line then also gives the parsing mode the definition is for, read
back from name (mode_of_twin_name), so that the two
lines differ.
Fields§
§name: StringThe name defined, as a user writes it: \flmUDhello for a macro,
flmUEnote for an environment. The style file holds one definition
per name.
source_name: StringThe name the document declared, written the same way: \hello,
note. Equal to name for a definition written bare.
text: StringThe definition’s LaTeX, as the emitter recomposed it.
robust: boolWhether the definition is a robust macro — one written through the
document command interface, which the render option robust_names asks
for — rather than the plain expandable macro a recomposed definition
otherwise is. It decides one thing here: which command the comment line
gives as the one that changes the definition after this file is loaded,
\RenewDocumentCommand for a robust macro and \renewcommand for an
expandable one. An environment is neither: it is always changed with
\RenewDocumentEnvironment.
feature: Option<String>The feature that wrote the definition from its own configuration, where
the document declared none (defterm for the environment of a defined
term): such a definition is guarded, and the style file writes it
before the document’s own definitions, its comment line giving the
feature’s name. None for a user definition.
declaration: boolWhether the definition is a feature’s declaration — LaTeX that
makes something other than a command definition, such as
\newtheorem, written as \ifcsname <name>\endcsname\else …\fi
(LatexDefinitionKind::Declaration).
name is then the control sequence the test checks, and
the comment line above it says what the test does rather than which
command changes the definition.
Implementations§
Source§impl RecomposedDefinition
impl RecomposedDefinition
Sourcepub fn new(
name: impl Into<String>,
source_name: impl Into<String>,
text: impl Into<String>,
) -> RecomposedDefinition
pub fn new( name: impl Into<String>, source_name: impl Into<String>, text: impl Into<String>, ) -> RecomposedDefinition
A definition of name, declared in the document under source_name,
whose LaTeX is text.
Sourcepub fn of_feature(self, feature: impl Into<String>) -> RecomposedDefinition
pub fn of_feature(self, feature: impl Into<String>) -> RecomposedDefinition
The same definition written by the feature feature from its own
configuration (feature).
Sourcepub fn robust(self) -> RecomposedDefinition
pub fn robust(self) -> RecomposedDefinition
The same definition marked as a robust macro
(robust).
Sourcepub fn declaration(self) -> RecomposedDefinition
pub fn declaration(self) -> RecomposedDefinition
The same definition marked as a feature’s declaration
(declaration).
Trait Implementations§
Source§impl Clone for RecomposedDefinition
impl Clone for RecomposedDefinition
Source§impl Debug for RecomposedDefinition
impl Debug for RecomposedDefinition
Source§impl Default for RecomposedDefinition
impl Default for RecomposedDefinition
impl Eq for RecomposedDefinition
Source§impl PartialEq for RecomposedDefinition
impl PartialEq for RecomposedDefinition
impl StructuralPartialEq for RecomposedDefinition
Auto Trait Implementations§
impl Forget for RecomposedDefinition
impl Freeze for RecomposedDefinition
impl Move for RecomposedDefinition
impl RefUnwindSafe for RecomposedDefinition
impl Send for RecomposedDefinitionwhere
RawVecInner: Send,
impl Sync for RecomposedDefinitionwhere
RawVecInner: Sync,
impl Unpin for RecomposedDefinition
impl UnsafeUnpin for RecomposedDefinition
impl UnwindSafe for RecomposedDefinitionwhere
RawVecInner: UnwindSafe,
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