pub trait IntoJsonWithContext<N>: Sized {
// Required method
fn into_json_with(self, context: &N) -> Value;
}Expand description
Values convertible into JSON through a vocabulary.
Required Methods§
Sourcefn into_json_with(self, context: &N) -> Value
fn into_json_with(self, context: &N) -> Value
Converts this value into JSON, resolving the identifiers it holds against the given vocabulary.
This conversion is infallible by design: every identifier is expected
to resolve in the given context (vocabulary). Passing a vocabulary the
value was not built against is a caller bug; implementations render
identifiers that fail to resolve as the literal string
"<unresolved iri>" rather than panicking.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".