Trait typst::foundations::NativeType

source ·
pub trait NativeType {
    const NAME: &'static str;

    // Required method
    fn data() -> &'static NativeTypeData;

    // Provided method
    fn ty() -> Type { ... }
}
Expand description

A Typst type that is defined by a native Rust type.

Required Associated Constants§

source

const NAME: &'static str

The type’s name.

In contrast to data(), this is usable in const contexts.

Required Methods§

source

fn data() -> &'static NativeTypeData

Provided Methods§

source

fn ty() -> Type

Get the type for the native Rust type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl NativeType for bool

source§

const NAME: &'static str = "bool"

source§

fn data() -> &'static NativeTypeData

source§

impl NativeType for f64

source§

const NAME: &'static str = "float"

source§

fn data() -> &'static NativeTypeData

source§

impl NativeType for i64

source§

const NAME: &'static str = "int"

source§

fn data() -> &'static NativeTypeData

Implementors§

source§

impl NativeType for Meta

source§

const NAME: &'static str = "meta"

source§

impl NativeType for Alignment

source§

const NAME: &'static str = "alignment"

source§

impl NativeType for Dir

source§

const NAME: &'static str = "direction"

source§

impl NativeType for Color

source§

const NAME: &'static str = "color"

source§

impl NativeType for Gradient

source§

const NAME: &'static str = "gradient"

source§

impl NativeType for Datetime

source§

const NAME: &'static str = "datetime"

source§

impl NativeType for Selector

source§

const NAME: &'static str = "selector"

source§

impl NativeType for Counter

source§

const NAME: &'static str = "counter"

source§

impl NativeType for Location

source§

const NAME: &'static str = "location"

source§

impl NativeType for State

source§

const NAME: &'static str = "state"

source§

impl NativeType for Angle

source§

const NAME: &'static str = "angle"

source§

impl NativeType for Fr

source§

const NAME: &'static str = "fraction"

source§

impl NativeType for Length

source§

const NAME: &'static str = "length"

source§

impl NativeType for Ratio

source§

const NAME: &'static str = "ratio"

source§

impl NativeType for Rel

source§

const NAME: &'static str = "relative"

source§

impl NativeType for CslStyle

source§

const NAME: &'static str = "csl-style"

source§

impl NativeType for Symbol

source§

const NAME: &'static str = "symbol"

source§

impl NativeType for Pattern

source§

const NAME: &'static str = "pattern"

source§

impl NativeType for Stroke

source§

const NAME: &'static str = "stroke"

source§

impl NativeType for Args

source§

const NAME: &'static str = "arguments"

source§

impl NativeType for Array

source§

const NAME: &'static str = "array"

source§

impl NativeType for AutoValue

source§

const NAME: &'static str = "auto"

source§

impl NativeType for Bytes

source§

const NAME: &'static str = "bytes"

source§

impl NativeType for Content

source§

const NAME: &'static str = "content"

source§

impl NativeType for Dict

source§

const NAME: &'static str = "dictionary"

source§

impl NativeType for Duration

source§

const NAME: &'static str = "duration"

source§

impl NativeType for Func

source§

const NAME: &'static str = "function"

source§

impl NativeType for Label

source§

const NAME: &'static str = "label"

source§

impl NativeType for Module

source§

const NAME: &'static str = "module"

source§

impl NativeType for NoneValue

source§

const NAME: &'static str = "none"

source§

impl NativeType for Plugin

source§

const NAME: &'static str = "plugin"

source§

impl NativeType for Regex

source§

const NAME: &'static str = "regex"

source§

impl NativeType for Str

source§

const NAME: &'static str = "str"

source§

impl NativeType for Styles

source§

const NAME: &'static str = "styles"

source§

impl NativeType for Type

source§

const NAME: &'static str = "type"

source§

impl NativeType for Version

source§

const NAME: &'static str = "version"