Skip to main content

DiagnosticLog

Struct DiagnosticLog 

Source
pub struct DiagnosticLog { /* private fields */ }
Expand description

The dedup state behind every render-time diagnostic a windowed renderer can emit.

Each graphical backend holds one DiagnosticLog field (Default-constructed) instead of a separate BTreeSet<char> per diagnostic, so the diagnostics a backend emits are exactly this struct’s methods, not something a reader has to reconstruct by finding every warned_* field and the free function it feeds. The methods here are thin wrappers over the free functions in this module and in sprite_cache, which remain the implementation and stay public for any caller that wants the dedup set itself rather than one owned alongside the others.

Constructing a DiagnosticLog never allocates: every set starts empty, and BTreeSet::default does not allocate until its first insert, so a release build (where every method’s body is compiled out by dev_only!) pays nothing for carrying this field.

Implementations§

Source§

impl DiagnosticLog

Source

pub fn notdef_glyph(&mut self, ch: char) -> bool

Reports ch if it resolved to the fallback notdef glyph rather than its own, at most once per character. See warn_notdef_glyph for what this means and why it is worth a diagnostic.

Source

pub fn sprite_needs_span( &mut self, glyph: char, sprite: (u32, u32), cell: (u32, u32), ) -> bool

Reports glyph’s sprite as drawn without a span reserving the cells it covers, at most once per glyph. See warn_sprite_needs_span for the full contract.

Source

pub fn tint_needs_sprite(&mut self, glyph: char, tint: Tint) -> bool

Reports glyph’s tint as dropped because it resolved to a bitmap font glyph rather than a sprite, at most once per glyph. See warn_tint_needs_sprite for the full contract.

Source

pub fn has_reported_notdef(&self, ch: char) -> bool

Whether notdef_glyph has already reported ch.

For a backend’s own test suite to assert the dedup behavior directly; production code only ever needs notdef_glyph’s own return value.

Source

pub fn has_reported_dropped_tint(&self, glyph: char) -> bool

Whether tint_needs_sprite has already reported glyph.

For a backend’s own test suite to assert the dedup behavior directly; production code only ever needs tint_needs_sprite’s own return value.

Source

pub fn dropped_tint_report_count(&self) -> usize

How many distinct glyphs tint_needs_sprite has reported so far.

For a backend’s own test suite to assert dedup collapses repeat reports to one; production code has no use for the count.

Trait Implementations§

Source§

impl Debug for DiagnosticLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DiagnosticLog

Source§

fn default() -> DiagnosticLog

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more