pub struct BlockPayload {
pub role: Option<Name>,
pub kinds: Vec<Name>,
pub anchor: Option<String>,
pub doc_role: Option<DocRole>,
}Expand description
The payload of flm.pres.block, a block container: its role and kinds
(what container it is), its anchor when it is a link target, and its
document role. See the module documentation.
Fields§
§role: Option<Name>The role: what the container is, as a dotted, feature-owned name. By
convention it is the source element’s name for the block that holds
the element as a whole, and <element>.<part> for a block inside it
that the element’s rule builds.
kinds: Vec<Name>The kind tokens that classify the role further (theoremlike,
lemma). A backend or a stylesheet uses them to choose among
renderings of the same role.
anchor: Option<String>The anchor, when the block is a link target.
doc_role: Option<DocRole>The block’s document role, when it has one: DocRole::Endnotes for
the container of a list of notes, DocRole::Footnote for a note
shown where it is written, DocRole::Bibliography for the container
of the list of cited works, DocRole::Toc for the container of a
table of contents. A backend without the notion ignores it.
Implementations§
Source§impl BlockPayload
impl BlockPayload
Sourcepub fn from_projection(
value: &SerialValue,
) -> Result<BlockPayload, DeserializeError>
pub fn from_projection( value: &SerialValue, ) -> Result<BlockPayload, DeserializeError>
The payload rebuilt from its projection, the value
project produced.
§Errors
Returns a DeserializeError mentioning flm.pres.block when the
projection is not a map, when role or anchor is present and is not a
string, when kinds is present and is not a list of strings, or when
doc_role is present and matches no document role (DocRole::parse).
Trait Implementations§
Source§impl Clone for BlockPayload
impl Clone for BlockPayload
Source§impl Debug for BlockPayload
impl Debug for BlockPayload
Source§impl Default for BlockPayload
impl Default for BlockPayload
impl Eq for BlockPayload
Source§impl PartialEq for BlockPayload
impl PartialEq for BlockPayload
Source§impl PresPayload for BlockPayload
impl PresPayload for BlockPayload
Source§fn project(&self) -> SerialValue
fn project(&self) -> SerialValue
impl StructuralPartialEq for BlockPayload
Auto Trait Implementations§
impl Forget for BlockPayload
impl Freeze for BlockPayloadwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Name>: Freeze,
PhantomData<u8>: Freeze,
impl Move for BlockPayload
impl RefUnwindSafe for BlockPayload
impl Send for BlockPayload
impl Sync for BlockPayload
impl Unpin for BlockPayload
impl UnsafeUnpin for BlockPayloadwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Name>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for BlockPayload
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