Skip to main content

InputSpec

Struct InputSpec 

Source
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

Source

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

Source§

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>>

Returns a fresh parser for one resolved invocation of this callable. Read more
Source§

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 more
Source§

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>>

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 more
Source§

fn serialize_argument_spec( &self, index: usize, argument_spec: &Arc<ArgumentSpec<L>>, cx: &mut SerializeContext<'_, L>, ) -> Result<Option<SerialValue>, SerializeError>

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 more
Source§

fn deserialize_argument_spec( &self, index: usize, value: Option<&SerialValue>, cx: &mut DeserializeContext<'_, L>, ) -> Result<Arc<ArgumentSpec<L>>, DeserializeError>

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 more
Source§

impl Debug for InputSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SerializableObject<Flm> for InputSpec

Source§

fn serialize_object( &self, cx: &mut SerializeContext<'_, L>, ) -> Result<SerialEntry, SerializeError>

Produce this object’s serialized form: its identifier and its data as a SerialEntry. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<L, S> IntoCallableSpec<L, ByValue> for S
where L: Lang, S: CallableSpec<L>,

Source§

fn into_callable_spec(self) -> Arc<dyn CallableSpec<L>> ⓘ

Convert into the shared spec handle providers store.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.