Skip to main content

VldInput

Trait VldInput 

Source
pub trait VldInput {
    // Required method
    fn to_json_value(&self) -> Result<Cow<'_, Value>, VldError>;
}
Expand description

Trait for types that can be used as input to schema parsing.

Implemented for JSON strings (str, String), raw bytes ([u8]), file paths (Path, PathBuf) and serde_json::Value (borrowed, never cloned).

Required Methods§

Source

fn to_json_value(&self) -> Result<Cow<'_, Value>, VldError>

The input as a JSON value: borrowed when it already is one, parsed otherwise.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl VldInput for Path

Source§

impl VldInput for PathBuf

Source§

impl VldInput for String

Source§

impl VldInput for Value

Source§

impl VldInput for [u8]

Source§

impl VldInput for str

Implementors§