Skip to main content

ToTypst

Trait ToTypst 

Source
pub trait ToTypst {
    // Required method
    fn to_typst(&self) -> String;
}
Expand description

Convert a Rust value to Typst source code.

§Example

use typst_batch::codegen::ToTypst;

assert_eq!("hello".to_typst(), r#""hello""#);
assert_eq!(42i64.to_typst(), "42");
assert_eq!(true.to_typst(), "true");

Required Methods§

Source

fn to_typst(&self) -> String

Generate Typst source code representation.

Implementations on Foreign Types§

Source§

impl ToTypst for &str

Source§

impl ToTypst for bool

Source§

impl ToTypst for f64

Source§

impl ToTypst for i64

Source§

impl ToTypst for str

Source§

impl ToTypst for String

Source§

impl<T: IntoValue + Clone> ToTypst for [T]

Source§

impl<T: IntoValue + Clone> ToTypst for Vec<T>

Source§

impl<T: ToTypst> ToTypst for Option<T>

Implementors§