pub enum ArgLayout {
Inline,
Blocks,
InlineOrBlocks,
}Expand description
How the block-structure pass lays out an argument’s content: as inline content, as a region of blocks, or as whichever of the two the content calls for.
Inline content is running text (words, formulas, commands such as
\emph{…}) with no paragraph inside it. A region of blocks holds
paragraphs and block-level constructs such as lists. The layout belongs to
the command’s declaration (ArgDef::layout); an author cannot choose it
where the command is written.
An argument declared with an opaque wrapper (ArgDef::opaque_wrapper)
takes only Inline: the block-structure pass carries
its content over as written, so no other layout could take effect. An
argument read in mathematics mode is an opaque
region, which the
block-structure pass carries over untouched, so it may not be declared
Blocks. Minting reports a declaration that breaks
either rule
(MintError::LayoutOnOpaqueWrappedArgument,
MintError::BlocksOnMathArgument).
A layout declared on an argument whose reader yields raw text or places
its content under an opaque wrapper by construction (a verbatim argument, a
characters-only group) is not reported; it has no effect, since the
argument’s content is an opaque region.
arg_layout_of returns the declared layout of an
argument of a parsed node;
argument_holds_blocks
returns whether an argument holds blocks, before and after the
block-structure pass alike.
Variants§
Inline
Inline content: no paragraph is built inside it, and a blank line in it is an error, reported and read as one space. The default.
Blocks
A region of blocks: paragraphs are built inside it, exactly as in an
environment body declared BodyLayout::Blocks. Content written on
one line becomes one paragraph.
InlineOrBlocks
Inferred from the content: a region of blocks when the content holds a
blank line (a paragraph break) or a block-level construct such as a
list, inline content otherwise. This is the rule a fragment laid out
InlineOrBlocks
applies to its top level.
Trait Implementations§
impl Copy for ArgLayout
Source§impl<'de> Deserialize<'de> for ArgLayout
impl<'de> Deserialize<'de> for ArgLayout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ArgLayout
Source§impl JsonSchema for ArgLayout
impl JsonSchema for ArgLayout
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for ArgLayout
Auto Trait Implementations§
impl Forget for ArgLayout
impl Freeze for ArgLayout
impl Move for ArgLayout
impl RefUnwindSafe for ArgLayout
impl Send for ArgLayout
impl Sync for ArgLayout
impl Unpin for ArgLayout
impl UnsafeUnpin for ArgLayout
impl UnwindSafe for ArgLayout
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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