[][src]Trait texrender::tpl::IntoTexElement

pub trait IntoTexElement {
    fn into_tex_element(self) -> Box<dyn TexElement>;
}

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

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

Converts the given element into a TexElement.

Loading content...

Implementations on Foreign Types

impl IntoTexElement for Box<dyn TexElement>[src]

impl<'a> IntoTexElement for &'a str[src]

impl IntoTexElement for String[src]

impl IntoTexElement for ()[src]

impl IntoTexElement for Vec<Box<dyn TexElement>>[src]

impl IntoTexElement for u8[src]

impl IntoTexElement for u16[src]

impl IntoTexElement for u32[src]

impl IntoTexElement for u64[src]

impl IntoTexElement for u128[src]

impl IntoTexElement for i8[src]

impl IntoTexElement for i16[src]

impl IntoTexElement for i32[src]

impl IntoTexElement for i64[src]

impl IntoTexElement for i128[src]

impl IntoTexElement for f32[src]

impl IntoTexElement for f64[src]

Loading content...

Implementors

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

Loading content...