Skip to main content

WithElement

Trait WithElement 

Source
pub trait WithElement<T, W: Warning> {
    type Output;

    // Required method
    fn with_element(self, element: &Element<'_>) -> Self::Output;
}
Expand description

Associate a json::Element with a set of deferred Warnings.

A deferred type carries warnings that are not yet tied to the element they describe, which is how a lowering avoids threading json::Element references through every step. This trait is the step that ties them, converting each deferred type into its associated counterpart: a CaveatDeferred becomes a Caveat, and the deferred result type becomes a Verdict.

Required Associated Types§

Source

type Output

The associated counterpart of the deferred type this is implemented for.

Required Methods§

Source

fn with_element(self, element: &Element<'_>) -> Self::Output

Associate every Warning carried by self with element.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T, W: Warning> WithElement<T, W> for Result<CaveatDeferred<T, W>, ErrorSetDeferred<W>>

Source§

fn with_element(self, element: &Element<'_>) -> Self::Output

Associate a json::Element with a set of Warnings.

Source§

type Output = Result<Caveat<T, W>, ErrorSet<W>>

Implementors§

Source§

impl<T, W: Warning> WithElement<T, W> for CaveatDeferred<T, W>

Source§

type Output = Caveat<T, W>