pub struct List { /* private fields */ }Expand description
(list feature) Accepts a list, with optional length bounds, a uniqueness check, and an optional
per-item validator.
Coercion: an empty map becomes an empty list (matching formats that render an empty
collection as {}). A non-empty map or any other type is rejected.
Implementations§
Source§impl List
impl List
Source§impl List
impl List
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
The description, if any.
Sourcepub fn examples(&self) -> &[(Value, Option<String>)]
pub fn examples(&self) -> &[(Value, Option<String>)]
The example values (each with an optional note).
Sourcepub fn default_value(&self) -> Option<&Value>
pub fn default_value(&self) -> Option<&Value>
The default value, if any.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Set the human-readable name (surfaced in error messages).
Sourcepub fn with_description(self, text: impl Into<String>) -> Self
pub fn with_description(self, text: impl Into<String>) -> Self
Attach a human-readable description.
Sourcepub fn with_example(self, value: impl Into<Value>) -> Self
pub fn with_example(self, value: impl Into<Value>) -> Self
Add an example value.
Sourcepub fn with_example_noted(
self,
value: impl Into<Value>,
note: impl Into<String>,
) -> Self
pub fn with_example_noted( self, value: impl Into<Value>, note: impl Into<String>, ) -> Self
Add an example value with an explanatory note.
Sourcepub fn with_default(self, value: impl Into<Value>) -> Self
pub fn with_default(self, value: impl Into<Value>) -> Self
Set the default value used as an on-error fallback (see the pipeline’s validate stage).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for List
impl !Send for List
impl !Sync for List
impl !UnwindSafe for List
impl Freeze for List
impl Unpin for List
impl UnsafeUnpin for List
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more