ParagraphBuilder

Trait ParagraphBuilder 

Source
pub trait ParagraphBuilder: Sized + 'static {
    type Paragraph: Paragraph;
    type Paint: Paint<Texture = Self::Texture>;
    type Fonts: Fonts;
    type Texture: Texture;

    // Required methods
    fn new(fonts: &Self::Fonts) -> Result<Self, &'static str>;
    fn push_style<'a>(
        &mut self,
        style: impl Into<OptRef<'a, ParagraphStyle<Self::Paint>>>,
    )
       where Self::Paint: 'a;
    fn pop_style(&mut self);
    fn add_text(&mut self, text: &str);
    fn build(self) -> Result<Self::Paragraph, &'static str>;
}

Required Associated Types§

Required Methods§

Source

fn new(fonts: &Self::Fonts) -> Result<Self, &'static str>

Source

fn push_style<'a>( &mut self, style: impl Into<OptRef<'a, ParagraphStyle<Self::Paint>>>, )
where Self::Paint: 'a,

Source

fn pop_style(&mut self)

Source

fn add_text(&mut self, text: &str)

Source

fn build(self) -> Result<Self::Paragraph, &'static str>

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.

Implementors§