Skip to main content

Finding

Struct Finding 

Source
pub struct Finding {
Show 18 fields pub rule_id: String, pub rule_name: Option<String>, pub outcome: Outcome, pub severity: Severity, pub message: String, pub location: Location, pub role: Option<String>, pub name: Option<String>, pub wcag: Vec<String>, pub wcag_level: Option<WcagLevel>, pub tags: Vec<String>, pub help: Option<String>, pub help_url: Option<String>, pub suggestion: Option<String>, pub suggested_code: Option<String>, pub snippet: Option<String>, pub evidence: Vec<Evidence>, pub extra: Extra,
}
Expand description

Ein Prüfergebnis.

Wird über Finding::fail, Finding::review, Finding::pass oder Finding::untested erzeugt und mit den with_*-Methoden angereichert — der Zustand ist damit immer bewusst gesetzt und nie ein Vorgabewert.

Fields§

§rule_id: String

Stabile Regelkennung, z. B. a11y/img-alt. Über alle Oberflächen identisch — das ist der Sinn des gemeinsamen Modells.

§rule_name: Option<String>

Menschenlesbarer Name der Regel, für Berichte, die mehr als die Kennung zeigen wollen.

§outcome: Outcome§severity: Severity§message: String

Was ist der Fall. Sachlich, ohne Handlungsanweisung.

§location: Location§role: Option<String>

Die berechnete Rolle des betroffenen Elements.

Gehört zum Befund, nicht zur Verortung: Wer einen Bericht liest, will wissen, was das Element für die Assistenztechnik war — ein Selektor allein sagt das nicht. Leer, wenn der Host keine Semantik liefert.

§name: Option<String>

Der Accessible Name des betroffenen Elements, soweit vorhanden.

§wcag: Vec<String>

Erfüllte bzw. verletzte WCAG-Erfolgskriterien, z. B. ["1.1.1"].

§wcag_level: Option<WcagLevel>§tags: Vec<String>

Freie Schlagworte, z. B. ["best-practice"] oder en301549:9.1.1.1.

§help: Option<String>

Was zu tun ist.

§help_url: Option<String>§suggestion: Option<String>

Konkreter Vorschlag in Prosa.

§suggested_code: Option<String>

Konkreter Vorschlag als Code.

§snippet: Option<String>

Das betroffene Markup, soweit der Host es liefern kann.

§evidence: Vec<Evidence>§extra: Extra

Werkzeugspezifische Beigabe. Nie serialisiert, nicht Teil der Identität dieses Befunds — siehe Extra.

Implementations§

Source§

impl Finding

Source

pub fn fail(rule_id: impl Into<String>, message: impl Into<String>) -> Self

Automatisch festgestelltes Problem.

Source

pub fn review(rule_id: impl Into<String>, message: impl Into<String>) -> Self

Heuristischer Verdacht — braucht menschliche Bestätigung.

Source

pub fn pass(rule_id: impl Into<String>, message: impl Into<String>) -> Self

Automatische Prüfung bestanden.

Source

pub fn untested(rule_id: impl Into<String>, message: impl Into<String>) -> Self

Automatisiert nicht beurteilbar — erzeugt einen Punkt auf der manuellen Prüfliste, kein Urteil.

Source

pub fn with_severity(self, s: Severity) -> Self

Source

pub fn with_rule_name(self, n: impl Into<String>) -> Self

Source

pub fn with_element(self, role: Option<String>, name: Option<String>) -> Self

Rolle und Accessible Name des betroffenen Elements.

Source

pub fn with_extra<T: Any + Send + Sync>(self, value: T) -> Self

Hängt eine werkzeugspezifische Beigabe an. Siehe Extra.

Source

pub fn at(self, l: Location) -> Self

Source

pub fn with_wcag( self, criteria: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Source

pub fn with_wcag_level(self, l: WcagLevel) -> Self

Source

pub fn with_tags( self, tags: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Source

pub fn with_help(self, help: impl Into<String>) -> Self

Source

pub fn with_help_url(self, url: impl Into<String>) -> Self

Source

pub fn with_suggestion(self, s: impl Into<String>) -> Self

Source

pub fn with_suggested_code(self, s: impl Into<String>) -> Self

Source

pub fn with_snippet(self, s: impl Into<String>) -> Self

Source

pub fn with_evidence(self, e: impl IntoIterator<Item = Evidence>) -> Self

Source

pub fn add_evidence(self, e: Evidence) -> Self

Trait Implementations§

Source§

impl Clone for Finding

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Finding

Source§

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

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

impl<'de> Deserialize<'de> for Finding

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Finding

Source§

impl PartialEq for Finding

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Finding

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Finding

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.