pub trait CharacterCache {
type Texture: ImageSize;
type Error: Debug;
// Required method
fn character(
&mut self,
font_size: FontSize,
ch: char,
) -> Result<Character<'_, Self::Texture>, Self::Error>;
// Provided method
fn width(
&mut self,
size: FontSize,
text: &str,
) -> Result<Scalar, Self::Error> { ... }
}Expand description
Stores characters in a buffer and loads them by demand.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".