pub struct MathTextPayload {
pub command: Option<String>,
pub anchor: Option<String>,
pub at_tag: bool,
}Expand description
The payload of flm.pres.math-text: the text command the content was
written in, and the anchor when the node is a link target.
The node’s body is the content itself (ordinary inline content, lowered
like content anywhere else), and the node is inside a
flm.pres.math-passthrough node, among that node’s source
text, at the content’s position in the formula.
A node with no content at all and an anchor is a link target placed at a point of the formula and showing nothing: such a node marks the start of a numbered equation line.
A node marked at_tag is at the position of a
line’s tag, inside the argument of the \tag* the tag is written as. The
mark is needed because the HTML and text backends write such a position
differently: the HTML backend wraps the content in a pair of dollar signs,
and the text backend writes the content unchanged, as an author would have
typed it.
Fields§
§command: Option<String>The text command the content was written in, without the leading
backslash (text, textbf, mbox); None when no command was
written, which is the case for a node that only carries an anchor.
anchor: Option<String>The anchor, when the node is a link target.
at_tag: boolWhether this content is at the position of an equation line’s tag: the
argument of the \tag* that writes a line’s tag, whether the tag is
the one its author wrote or the number the document gave the line.
The HTML backend writes a pair of dollar signs around the content of such a node and nothing around any other; every other backend writes the content the same way wherever it is.
Implementations§
Source§impl MathTextPayload
impl MathTextPayload
Sourcepub fn from_projection(
value: &SerialValue,
) -> Result<MathTextPayload, DeserializeError>
pub fn from_projection( value: &SerialValue, ) -> Result<MathTextPayload, DeserializeError>
The payload rebuilt from its projection, the value
project produced.
§Errors
Returns a DeserializeError mentioning flm.pres.math-text when the
projection is not a map, when command or anchor is present and is
not a string, or when at_tag is present and is not a boolean.
Trait Implementations§
Source§impl Clone for MathTextPayload
impl Clone for MathTextPayload
Source§impl Debug for MathTextPayload
impl Debug for MathTextPayload
Source§impl Default for MathTextPayload
impl Default for MathTextPayload
impl Eq for MathTextPayload
Source§impl PartialEq for MathTextPayload
impl PartialEq for MathTextPayload
Source§impl PresPayload for MathTextPayload
impl PresPayload for MathTextPayload
Source§fn project(&self) -> SerialValue
fn project(&self) -> SerialValue
impl StructuralPartialEq for MathTextPayload
Auto Trait Implementations§
impl Forget for MathTextPayload
impl Freeze for MathTextPayload
impl Move for MathTextPayload
impl RefUnwindSafe for MathTextPayload
impl Send for MathTextPayload
impl Sync for MathTextPayload
impl Unpin for MathTextPayload
impl UnsafeUnpin for MathTextPayload
impl UnwindSafe for MathTextPayload
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