pub struct ScopedPackageDef {
pub owner: FeatureName,
pub name: Name,
pub elements: Vec<ElementDef>,
pub docs: String,
}Expand description
A scoped package: a set of element declarations that can be written only
inside the environment bodies and arguments whose declarations refer to the
package by name, for instance \item inside a list’s body or \caption
inside a float’s body.
A body refers to a scoped package with BodyDef::scoped, an argument
with ArgDef::scoped. While such a body or argument is parsed, the
package’s declarations are available there and shadow any other definition
of the same names; outside, they do not exist.
Minting builds one techy package per scoped package. That package is not
on the document’s scope stack: it is added as the innermost techy package
only while a body or an argument that refers to it is parsed. Minting never
checks the declarations of a scoped package for clashes with those of
another scoped package or of a feature; only two scoped packages of one
name clash (ClashKind::ScopedPackage).
A feature declares a scoped package with
FeatureBuilder::scoped_package.
A body or an argument may refer to a scoped package that another feature
declares. The referring feature then declares the name as a peer
(FeatureBuilder::peer_scoped_package),
so that a registry without the owning feature still builds: the referring
bodies and arguments then make no command available through the package.
See also scoped packages.
Fields§
§owner: FeatureNameThe feature that declares the package; the feature builder sets it, and sets it on each of the package’s element declarations too.
name: NameThe name by which a body or an argument refers to the package. It must
be unique across the registry: minting reports a second package of the
same name as a MintError::Clash and builds
only the first.
elements: Vec<ElementDef>The element declarations the package holds.
docs: StringDocumentation of the package. 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.
Trait Implementations§
Source§impl Clone for ScopedPackageDef
impl Clone for ScopedPackageDef
Auto Trait Implementations§
impl !RefUnwindSafe for ScopedPackageDef
impl !UnwindSafe for ScopedPackageDef
impl Forget for ScopedPackageDef
impl Freeze for ScopedPackageDefwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<ElementDef>: Freeze,
PhantomData<u8>: Freeze,
impl Move for ScopedPackageDef
impl Send for ScopedPackageDefwhere
Arc<str>: Send,
RawVecInner: Send,
Arc<dyn FlmArgumentParser>: Send,
Arc<dyn FlmBodyParser>: Send,
Arc<ElementSpec>: Send,
impl Sync for ScopedPackageDefwhere
Arc<str>: Sync,
RawVecInner: Sync,
Arc<dyn FlmArgumentParser>: Sync,
Arc<dyn FlmBodyParser>: Sync,
Arc<ElementSpec>: Sync,
impl Unpin for ScopedPackageDefwhere
Arc<str>: Unpin,
*const u8 is !null: Unpin,
Arc<dyn FlmArgumentParser>: Unpin,
Arc<dyn FlmBodyParser>: Unpin,
Arc<ElementSpec>: Unpin,
impl UnsafeUnpin for ScopedPackageDefwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<ElementDef>: UnsafeUnpin,
PhantomData<u8>: 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<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