Trait IntoTexElement

Source
pub trait IntoTexElement {
    // Required method
    fn into_tex_element(self) -> Box<dyn TexElement>;
}
Expand description

Conversion trait for various types.

Used for primitive conversions of various types directly into tex elements. Implementations include:

  • Box<dyn TexElement> are passed through unchanged.
  • Any other TexElement will be boxed.
  • str and String are converted to escaped Text elements.
  • Any number (u8, …) is converted to escaped Text using display.
  • A Vec<Box<dyn TexElement>> is converted into a Group.
  • The unit type () is converted into an empty element.

Required Methods§

Source

fn into_tex_element(self) -> Box<dyn TexElement>

Converts the given element into a TexElement.

Implementations on Foreign Types§

Source§

impl IntoTexElement for f32

Source§

impl IntoTexElement for f64

Source§

impl IntoTexElement for i8

Source§

impl IntoTexElement for i16

Source§

impl IntoTexElement for i32

Source§

impl IntoTexElement for i64

Source§

impl IntoTexElement for i128

Source§

impl IntoTexElement for u8

Source§

impl IntoTexElement for u16

Source§

impl IntoTexElement for u32

Source§

impl IntoTexElement for u64

Source§

impl IntoTexElement for u128

Source§

impl IntoTexElement for ()

Source§

impl IntoTexElement for Box<dyn TexElement>

Source§

impl IntoTexElement for String

Source§

impl IntoTexElement for Vec<Box<dyn TexElement>>

Source§

impl<'a> IntoTexElement for &'a str

Implementors§

Source§

impl<T: TexElement + Sized + 'static> IntoTexElement for T