pub trait Optional<'de>: Deserialize<'de> {
// Provided methods
fn optional() -> bool { ... }
fn unwrap_none() -> Self { ... }
}
Expand description
“Introspection” by tracing a Deserialize
to see if it’s Option
-like.
This allows us to smoothly translate between rust functions that take an optional parameter, and the content descriptors in OpenRPC.
Provided Methods§
fn optional() -> bool
sourcefn unwrap_none() -> Self
fn unwrap_none() -> Self
§Panics
- This is only safe to call if
Optional::optional
returnstrue
.
Object Safety§
This trait is not object safe.