Struct fm::color_cache::ColorCache
source · pub struct ColorCache { /* private fields */ }Expand description
Holds a map of extension name to color. Every extension is associated to a color which is only computed once per run. This trades a bit of memory for a bit of CPU.
Implementations§
source§impl ColorCache
impl ColorCache
sourcepub fn extension_color(&self, extension: &str) -> Color
pub fn extension_color(&self, extension: &str) -> Color
Returns a color for any possible extension. The color is cached within the struct, avoiding multiple calculations.
Trait Implementations§
source§impl Default for ColorCache
impl Default for ColorCache
source§fn default() -> ColorCache
fn default() -> ColorCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ColorCache
impl Send for ColorCache
impl !Sync for ColorCache
impl Unpin for ColorCache
impl UnwindSafe for ColorCache
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().