pub struct TackOnField {
pub name: String,
pub args: Vec<ArgDef>,
pub repeatable: bool,
pub docs: String,
}Expand description
The declaration of one tack-on field: a macro that a construct absorbs
as data after its own arguments, as \section{…} absorbs the \label{…}
written after it.
A construct accepts its tack-on fields through its tack-on argument, an
argument declared as ArgStdKind::TackOn with the list of fields,
usually its last. A field is written like a macro, but its name is not
defined as a command anywhere: only the construct that declares the field
accepts it, and only where that construct’s tack-on argument stands.
A field is data that the declaring construct reads, not content: its
node is a macro node named as the field is written, carrying the language’s
field element (FIELD), the same element
for every field, and the construct that declared the field is its only
reader. The declaration is data only: a name, arguments, whether the field
repeats, and documentation. See the field module and
fields.
Settings given as data declare a field in the structured syntax tack-on
of its tack-on argument (the kind as data).
Fields§
§name: StringThe field’s name, without the escape character (label), distinct
from the names of the other fields of its tack-on argument.
args: Vec<ArgDef>The field’s own arguments, in the order they are written.
repeatable: boolWhether the field may be written more than once after one construct.
docs: StringDocumentation of the field. The library does not act on it; the
registry keeps it with the declaration
(FlmRegistry::declarations)
for a program that describes what an author may write.
Implementations§
Source§impl TackOnField
impl TackOnField
Sourcepub fn new(name: impl Into<String>, args: Vec<ArgDef>) -> TackOnField
pub fn new(name: impl Into<String>, args: Vec<ArgDef>) -> TackOnField
Declares a field written \name, taking the given arguments, which may
be written at most once after the construct;
TackOnField::repeatable allows it more than once.
Sourcepub fn repeatable(self) -> TackOnField
pub fn repeatable(self) -> TackOnField
Builder: the field may be written more than once after one construct.
Sourcepub fn docs(self, docs: impl Into<String>) -> TackOnField
pub fn docs(self, docs: impl Into<String>) -> TackOnField
Builder: sets the field’s documentation.
Trait Implementations§
Source§impl Clone for TackOnField
impl Clone for TackOnField
Source§impl Debug for TackOnField
impl Debug for TackOnField
impl Eq for TackOnField
Source§impl PartialEq for TackOnField
impl PartialEq for TackOnField
impl StructuralPartialEq for TackOnField
Auto Trait Implementations§
impl !RefUnwindSafe for TackOnField
impl !UnwindSafe for TackOnField
impl Forget for TackOnField
impl Freeze for TackOnField
impl Move for TackOnField
impl Send for TackOnField
impl Sync for TackOnField
impl Unpin for TackOnField
impl UnsafeUnpin for TackOnFieldwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ArgDef>: 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