tinymist_std::typst::foundations

Trait FromValue

pub trait FromValue<V = Value>: Sized + Reflect {
    // Required method
    fn from_value(value: V) -> Result<Self, HintedString>;
}
Expand description

Try to cast a Typst Value into a Rust type.

See also: Reflect.

Required Methods§

fn from_value(value: V) -> Result<Self, HintedString>

Try to cast the value into an instance of Self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl FromValue for bool

§

impl FromValue for char

§

impl FromValue for f64

§

impl FromValue for i8

§

impl FromValue for i16

§

impl FromValue for i32

§

impl FromValue for i64

§

impl FromValue for isize

§

impl FromValue for u8

§

impl FromValue for u16

§

impl FromValue for u32

§

impl FromValue for u64

§

impl FromValue for ()

§

impl FromValue for usize

§

impl FromValue for String

§

impl FromValue for NonZero<i64>

§

impl FromValue for NonZero<isize>

§

impl FromValue for NonZero<u64>

§

impl FromValue for NonZero<usize>

§

impl FromValue for MathClass

§

fn from_value(value: Value) -> Result<MathClass, HintedString>

§

impl FromValue for Month

§

fn from_value(value: Value) -> Result<Month, HintedString>

§

impl<T> FromValue for Option<T>
where T: FromValue,

§

impl<T> FromValue for Arc<T>
where T: FromValue,

§

impl<T> FromValue for Vec<T>
where T: FromValue,

§

impl<T> FromValue<Spanned<Value>> for Spanned<T>
where T: FromValue,

§

fn from_value(value: Spanned<Value>) -> Result<Spanned<T>, HintedString>

§

impl<T, const N: usize> FromValue for SmallVec<[T; N]>
where T: FromValue,

§

fn from_value(value: Value) -> Result<SmallVec<[T; N]>, HintedString>

Implementors§

§

impl FromValue for Datetime

§

impl FromValue for AngleLike

§

impl FromValue for DecNum

§

impl FromValue for Num

§

impl FromValue for ArgumentKey

§

impl FromValue for Endianness

§

impl FromValue for Never

§

impl FromValue for Replacement

§

impl FromValue for Selector

§

impl FromValue for StrPattern

§

impl FromValue for StrSide

§

impl FromValue for Target

§

impl FromValue for ToDecimal

§

impl FromValue for ToStr

§

impl FromValue for Transformation

§

impl FromValue for Value

§

impl FromValue for VersionComponents

§

impl FromValue for EcoString

§

impl FromValue for Bytes

§

impl FromValue for Dict

§

impl FromValue for ToAbs

§

impl FromValue for Args

§

impl FromValue for Array

§

impl FromValue for AutoValue

§

impl FromValue for Content

§

impl FromValue for Decimal

§

impl FromValue for DisplayPattern

§

impl FromValue for Duration

§

impl FromValue for Element

§

impl FromValue for Func

§

impl FromValue for Label

§

impl FromValue for LocatableSelector

§

impl FromValue for Module

§

impl FromValue for NoneValue

§

impl FromValue for PluginFunc

§

impl FromValue for Regex

§

impl FromValue for ShowableSelector

§

impl FromValue for Str

§

impl FromValue for Styles

§

impl FromValue for Symbol

§

impl FromValue for SymbolVariant

§

impl FromValue for ToArray

§

impl FromValue for ToBytes

§

impl FromValue for ToDict

§

impl FromValue for ToFloat

§

impl FromValue for ToInt

§

impl FromValue for Type

§

impl FromValue for Version

§

impl FromValue for Accent

§

impl FromValue for Alignment

§

impl FromValue for Angle

§

impl FromValue for Attribution

§

impl FromValue for Augment

§

impl FromValue for AugmentOffsets

§

impl FromValue for Author

§

impl FromValue for Axes<Length>

§

impl FromValue for Axes<Ratio>

§

impl FromValue for Axes<Rel>

§

impl FromValue for Axis

§

impl FromValue for Binding

§

impl FromValue for BlockBody

§

impl FromValue for BottomEdge

§

impl FromValue for BottomEdgeMetric

§

impl FromValue for CancelAngle

§

impl FromValue for Case

§

impl FromValue for Caseable

§

impl FromValue for ChromaComponent

§

impl FromValue for CitationForm

§

impl FromValue for CiteElem

§

impl FromValue for CloseMode

§

impl FromValue for Color

§

impl FromValue for ColorSpace

§

impl FromValue for Component

§

impl FromValue for Costs

§

impl FromValue for Counter

§

impl FromValue for CounterKey

§

impl FromValue for CounterState

§

impl FromValue for CounterUpdate

§

impl FromValue for Covers

§

impl FromValue for CslSource

§

impl FromValue for CurveComponent

§

impl FromValue for DashLength

§

impl FromValue for DashPattern

§

impl FromValue for DataSource

§

impl FromValue for Delimiter

§

impl FromValue for Delimiter

§

impl FromValue for DelimiterPair

§

impl FromValue for Destination

§

impl FromValue for Dir

§

impl FromValue for EmbeddedFileRelationship

§

impl FromValue for Encoding

§

impl FromValue for EnumItem

§

impl FromValue for EvalMode

§

impl FromValue for ExchangeFormat

§

impl FromValue for FigureCaption

§

impl FromValue for FigureKind

§

impl FromValue for FillRule

§

impl FromValue for FirstLineIndent

§

impl FromValue for FontFamily

§

impl FromValue for FontFeatures

§

impl FromValue for FontList

§

impl FromValue for FontStretch

§

impl FromValue for FontStyle

§

impl FromValue for FontWeight

§

impl FromValue for FootnoteBody

§

impl FromValue for FootnoteElem

§

impl FromValue for Fr

§

impl FromValue for Gradient

§

impl FromValue for GradientStop

§

impl FromValue for GridCell

§

impl FromValue for GridChild

§

impl FromValue for GridItem

§

impl FromValue for HAlignment

§

impl FromValue for HtmlAttr

§

impl FromValue for HtmlAttrs

§

impl FromValue for HtmlTag

§

impl FromValue for ImageFit

§

impl FromValue for ImageFormat

§

impl FromValue for ImageScaling

§

impl FromValue for Keywords

§

impl FromValue for Lang

§

impl FromValue for Length

§

impl FromValue for LineCap

§

impl FromValue for LineJoin

§

impl FromValue for LineNumberingScope

§

impl FromValue for Linebreaks

§

impl FromValue for LinkTarget

§

impl FromValue for ListItem

§

impl FromValue for ListMarker

§

impl FromValue for Location

§

impl FromValue for Margin

§

impl FromValue for Marginal

§

impl FromValue for MathSize

§

impl FromValue for MathVariant

§

impl FromValue for NumberType

§

impl FromValue for NumberWidth

§

impl FromValue for Numbering

§

impl FromValue for NumberingPattern

§

impl FromValue for OuterHAlignment

§

impl FromValue for OuterVAlignment

§

impl FromValue for OutlineEntry

§

impl FromValue for OutlineIndent

§

impl FromValue for Paint

§

impl FromValue for Paper

§

impl FromValue for Parity

§

impl FromValue for PathVertex

§

impl FromValue for PixelEncoding

§

impl FromValue for PixelFormat

§

impl FromValue for PlacementScope

§

impl FromValue for Position

§

impl FromValue for RasterFormat

§

impl FromValue for Ratio

§

impl FromValue for RatioComponent

§

impl FromValue for RatioOrAngle

§

impl FromValue for RawContent

§

impl FromValue for Readable

§

impl FromValue for RefForm

§

impl FromValue for Region

§

impl FromValue for Rel

§

impl FromValue for RelativeTo

§

impl FromValue for RowType

§

impl FromValue for ScaleAmount

§

impl FromValue for Side

§

impl FromValue for Sizing

§

impl FromValue for SmartQuoteDict

§

impl FromValue for SmartQuoteSet

§

impl FromValue for Spacing

§

impl FromValue for StackChild

§

impl FromValue for State

§

impl FromValue for StateUpdate

§

impl FromValue for Stroke

§

impl FromValue for StylisticSets

§

impl FromValue for Supplement

§

impl FromValue for TableCell

§

impl FromValue for TableChild

§

impl FromValue for TableItem

§

impl FromValue for TermItem

§

impl FromValue for TextDir

§

impl FromValue for TextSize

§

impl FromValue for Tiling

§

impl FromValue for TopEdge

§

impl FromValue for TopEdgeMetric

§

impl FromValue for TrackSizings

§

impl FromValue for Url

§

impl FromValue for VAlignment

§

impl FromValue for VElem

§

impl FromValue for VectorFormat

§

impl FromValue for VerticalFontMetric

§

impl FromValue for WeightedColor

§

impl FromValue for WritingScript

§

impl<H, V> FromValue for SpecificAlignment<H, V>
where H: Reflect + TryFrom<Alignment, Error = EcoString>, V: Reflect + TryFrom<Alignment, Error = EcoString>,

§

impl<T> FromValue for Smart<T>
where T: FromValue,

§

impl<T> FromValue for OneOrMultiple<T>
where T: FromValue,

§

impl<T> FromValue for Packed<T>

§

impl<T> FromValue for Celled<T>
where T: FromValue,

§

impl<T> FromValue for Corners<Option<T>>
where T: FromValue + Clone,

§

impl<T> FromValue for Sides<Option<T>>
where T: Default + FromValue + Clone,

§

impl<T> FromValue<Spanned<Value>> for T
where T: FromValue,