pub struct InputSpec { /* private fields */ }Expand description
An InputSpec is the specification of an inclusion macro, such as
\input. It contains the arguments of the macro and provides the parser
that includes the file (see the module documentation).
To define an inclusion macro in a feature, declare an element with the
syntax SyntaxDef::Inclusion.
Minting then creates the InputSpec, and wraps it in
an FlmCallable like the specification of every macro.
Implementations§
Source§impl InputSpec
impl InputSpec
Sourcepub fn new(arguments: Vec<Arc<ArgumentSpec<Flm>>>) -> Result<InputSpec, String>
pub fn new(arguments: Vec<Arc<ArgumentSpec<Flm>>>) -> Result<InputSpec, String>
Returns the specification of an inclusion macro with the arguments
arguments, in the order in which they are written.
§Errors
Returns an error if no argument is named REFERENCE_ARGUMENT. The
error is a description of the declared arguments, which minting embeds
in the message of its own error.
Trait Implementations§
Source§impl CallableSpec<Flm> for InputSpec
impl CallableSpec<Flm> for InputSpec
Source§fn arguments(&self) -> &[Arc<ArgumentSpec<Flm>>]
fn arguments(&self) -> &[Arc<ArgumentSpec<Flm>>]
The declarative argument structure of an invocation, in invocation order.
Default: no arguments.
Source§fn make_invocation_parser<'a>(
&'a self,
invocation: Invocation<'a, Flm>,
) -> Result<Box<dyn ConstructParser<Flm, Output = BuildId> + 'a>, ParseError<FlmOrigin>>
fn make_invocation_parser<'a>( &'a self, invocation: Invocation<'a, Flm>, ) -> Result<Box<dyn ConstructParser<Flm, Output = BuildId> + 'a>, ParseError<FlmOrigin>>
Returns a fresh parser for one resolved invocation of this callable. Read more
Source§fn requires_content(&self) -> bool
fn requires_content(&self) -> bool
Whether an invocation of this callable requires material after it — whether
appearing bare, as a single-token expression argument (
\frac\mymacro 2),
would be malformed. Read moreSource§fn stack_frame_title(&self, role: FrameRole, name: &str) -> String
fn stack_frame_title(&self, role: FrameRole, name: &str) -> String
Returns the title of a parse-traceback frame covering this callable. Read more
Source§fn provenance(&self) -> Option<&SpecProvenance<L>>
fn provenance(&self) -> Option<&SpecProvenance<L>>
Where this spec is defined, when it records that: the
SpecProvenance stamp
issued by a shared Package
(Package::provenance_for) and
stored by the spec type. Reading it through the Arc<dyn CallableSpec<L>> a
node holds needs no downcast to the concrete spec type. Read moreSource§fn serialize_argument_spec(
&self,
index: usize,
argument_spec: &Arc<ArgumentSpec<L>>,
cx: &mut SerializeContext<'_, L>,
) -> Result<Option<SerialValue>, SerializeError>where
L: SerializableLang,
fn serialize_argument_spec(
&self,
index: usize,
argument_spec: &Arc<ArgumentSpec<L>>,
cx: &mut SerializeContext<'_, L>,
) -> Result<Option<SerialValue>, SerializeError>where
L: SerializableLang,
Serialize the argument spec a parsed argument of this callable was parsed
against — the
ArgumentSpec Arc recorded on the parsed argument at
position index (invocation order). Called by the tree serialization for each
parsed argument of a callable node whose spec is self. Read moreSource§fn deserialize_argument_spec(
&self,
index: usize,
value: Option<&SerialValue>,
cx: &mut DeserializeContext<'_, L>,
) -> Result<Arc<ArgumentSpec<L>>, DeserializeError>where
L: SerializableLang,
fn deserialize_argument_spec(
&self,
index: usize,
value: Option<&SerialValue>,
cx: &mut DeserializeContext<'_, L>,
) -> Result<Arc<ArgumentSpec<L>>, DeserializeError>where
L: SerializableLang,
Rebuild the argument spec of a parsed argument of this callable from its
serialized form — the counterpart of
serialize_argument_spec, called on the
freshly rebuilt callable spec for each serialized argument at position index
(invocation order). value is what serialize_argument_spec returned when the
argument was written: None under the index rule, Some(_) from an override.
cx gives the call access to the state of the deserialization in progress. Read moreSource§impl SerializableObject<Flm> for InputSpec
impl SerializableObject<Flm> for InputSpec
Source§fn serialize_object(
&self,
cx: &mut SerializeContext<'_, L>,
) -> Result<SerialEntry, SerializeError>where
L: SerializableLang,
fn serialize_object(
&self,
cx: &mut SerializeContext<'_, L>,
) -> Result<SerialEntry, SerializeError>where
L: SerializableLang,
Produce this object’s serialized form: its identifier and its data as a
SerialEntry. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for InputSpec
impl !UnwindSafe for InputSpec
impl Forget for InputSpec
impl Freeze for InputSpec
impl Move for InputSpec
impl Send for InputSpec
impl Sync for InputSpec
impl Unpin for InputSpec
impl UnsafeUnpin for InputSpec
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
Mutably borrows from an owned value. Read more
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>,
Casts the value.
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>
Casts the value.
Source§impl<L, S> IntoCallableSpec<L, ByValue> for Swhere
L: Lang,
S: CallableSpec<L>,
impl<L, S> IntoCallableSpec<L, ByValue> for Swhere
L: Lang,
S: CallableSpec<L>,
Source§fn into_callable_spec(self) -> Arc<dyn CallableSpec<L>> ⓘ
fn into_callable_spec(self) -> Arc<dyn CallableSpec<L>> ⓘ
Convert into the shared spec handle providers store.
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> ⓘ
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 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> ⓘ
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 moreSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.