pub trait EnumerableNode: Sync {
// Required methods
fn kind(&self) -> &'static str;
fn doc(&self) -> &'static str;
fn elements(&self, partial: Option<&Value>) -> Vec<ElementSpec>;
// Provided methods
fn open_surface(&self) -> Option<&'static str> { ... }
fn validate(&self, value: &Value, mode: Mode) -> Vec<Violation>
where Self: Sized { ... }
}Expand description
An enumerable node kind of the workload construction grammar.
Required Methods§
Provided Methods§
Sourcefn open_surface(&self) -> Option<&'static str>
fn open_surface(&self) -> Option<&'static str>
When this node also accepts keys OUTSIDE the enumerated
set, the reason (open vocabularies are declared, never
implied). None = closed surface.
Sourcefn validate(&self, value: &Value, mode: Mode) -> Vec<Violation>where
Self: Sized,
fn validate(&self, value: &Value, mode: Mode) -> Vec<Violation>where
Self: Sized,
Validate value as an instance of this node kind:
unknown keys on closed surfaces, form conformance per
element, and (in Mode::Complete) required elements —
recursing through nested node references. This is the
runtime type check of the construction grammar.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".