pub struct OpenObject(pub Vec<(String, Value)>);Expand description
An object with any keys and any values, kept in input order.
Tuple Fields§
§0: Vec<(String, Value)>Trait Implementations§
Source§impl Clone for OpenObject
impl Clone for OpenObject
Source§impl Debug for OpenObject
impl Debug for OpenObject
Source§impl PartialEq for OpenObject
impl PartialEq for OpenObject
Source§impl Shape for OpenObject
impl Shape for OpenObject
Source§const CLASS: Class = Class::OpenObject
const CLASS: Class = Class::OpenObject
The class of the shape, which decides at compile time which constraints a field of this type may carry.
Source§const CATCH_ALL: bool = true
const CATCH_ALL: bool = true
Whether the type collects the members of an object that no field names, so a flattened field of it types them.
Source§fn catch_all_shape() -> Option<ShapeDef>
fn catch_all_shape() -> Option<ShapeDef>
The shape of those members, for a type with
CATCH_ALL.Source§fn build_rest(
value: &Value,
path: &mut Path,
known: &[&str],
) -> Result<Self, Issues>
fn build_rest( value: &Value, path: &mut Path, known: &[&str], ) -> Result<Self, Issues>
Converts the members of an object that are not in
known, for a type with CATCH_ALL.Source§fn reference() -> ShapeDef
fn reference() -> ShapeDef
How a field of this type is described: a named type gives a reference to its definition, a built-in gives
its shape inline.
Source§fn build(value: &Value, path: &mut Path) -> Result<Self, Issues>
fn build(value: &Value, path: &mut Path) -> Result<Self, Issues>
Converts a value that already matches this type’s shape. A mismatch means the shape and the conversion
disagree, and is reported as an issue rather than a panic.
Source§const IS_OBJECT: bool = false
const IS_OBJECT: bool = false
Whether the type is a struct, which is what a flattened field and a newtype variant of a tagged enum must be.
Source§const KEYS: &'static [&'static str]
const KEYS: &'static [&'static str]
The keys of the object this type is, own and flattened, which a derive checks for duplicates at compile time.
Source§fn definition() -> ShapeDef
fn definition() -> ShapeDef
The complete shape of this type, which for a named type is what its definition holds.
Source§fn register_members(registry: &mut Registry)
fn register_members(registry: &mut Registry)
Adds the named types this type’s fields refer to, without this type itself, for a type whose fields are
merged into another object’s definition.
Source§fn absent() -> Option<Self>
fn absent() -> Option<Self>
The value of a field of this type that is absent from its object, for a type that allows that.
Source§fn definitions() -> Cow<'static, Definitions>
fn definitions() -> Cow<'static, Definitions>
The definitions this type is described by.
impl StructuralPartialEq for OpenObject
Auto Trait Implementations§
impl Forget for OpenObject
impl Freeze for OpenObject
impl Move for OpenObject
impl RefUnwindSafe for OpenObject
impl Send for OpenObject
impl Sync for OpenObject
impl Unpin for OpenObject
impl UnsafeUnpin for OpenObject
impl UnwindSafe for OpenObject
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