Skip to main content

DiagnosticMessages

Trait DiagnosticMessages 

Source
pub trait DiagnosticMessages: Send + Sync {
    // Provided methods
    fn yanked_message(&self) -> &'static str { ... }
    fn yanked_label(&self) -> &'static str { ... }
    fn deprecated_message(&self) -> &'static str { ... }
    fn deprecated_label(&self) -> &'static str { ... }
}
Expand description

Static wording for diagnostics and hover about yanked/deprecated package state.

Implementors guarantee every method here returns a 'static string with no per-call computation — this is display copy, not logic — so callers may cache or repeat these values freely across an entire diagnostics pass without re-invoking the formatter.

Provided Methods§

Source

fn yanked_message(&self) -> &'static str

Message for yanked/deprecated versions in diagnostics.

Source

fn yanked_label(&self) -> &'static str

Label for yanked versions in hover.

Source

fn deprecated_message(&self) -> &'static str

Message for a package-level deprecation/abandonment diagnostic (issue #205).

Distinct from Self::yanked_message: that one describes a single flagged version, this one describes the package being deprecated/abandoned/archived. Default wording is generic; ComposerFormatter overrides both this and Self::deprecated_label to “abandoned”, matching Packagist’s own vocabulary — the same pattern it already applies to the yanked pair.

Source

fn deprecated_label(&self) -> &'static str

Label for a deprecated package in hover.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§