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§
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>
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.