Struct ijson::object::IObject [−][src]
#[repr(transparent)]pub struct IObject(_);
Expand description
The IObject
type is similar to a HashMap<IString, IValue>
. As with the
IArray
, the length and capacity are stored inside the heap allocation.
In addition, IObject
s preserve the insertion order of their elements, in
case that is important in the original JSON.
Removing from an IObject
will disrupt the insertion order.
Implementations
Constructs a new IObject
with the specified capacity. At least that many entries
can be added to the object without reallocating.
Returns the capacity of the object. This is the maximum number of entries the object can hold without reallocating.
Reserves space for at least this many additional entries.
Returns a view of an entry within this object.
Returns a view of an entry within this object, whilst avoiding cloning the key if the entry is already occupied.
Returns an iterator over references to the keys in this object.
Returns an iterator over references to the values in this object.
Returns an iterator over (&key, &value) pairs in this object.
Returns an iterator over mutable references to the values in this object.
Returns an iterator over (&key, &mut value) pairs in this object.
Looks up the specified key in this object and returns a (&key, &value) pair if found.
Looks up the specified key in this object and returns a (&key, &mut value) pair if found.
Looks up the specified key in this object and returns a reference to the corresponding value if found.
Looks up the specified key in this object and returns a mutable reference to the corresponding value if found.
Returns true
if the specified key exists in the object.
Inserts a new value into this object with the specified key. If a value already existed at this key, that value is replaced and returend.
Removes the entry at the specified key, returning both the key and value if found.
Removes the entry at the specified key, returning the value if found.
Shrinks the memory allocation used by the object such that its capacity becomes equal to its length.
Trait Implementations
Mutably borrows from an owned value. Read more
Deserialize this value from the given Serde deserializer. Read more
The error type that can be returned if some error occurs during deserialization. Read more
Require the Deserializer
to figure out how to drive the visitor based
on what data type is in the input. Read more
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an enum value with a
particular name and possible variants. Read more
Hint that the Deserialize
type is expecting a newtype struct with a
particular name. Read more
Hint that the Deserialize
type is expecting a bool
value.
Hint that the Deserialize
type is expecting an i8
value.
Hint that the Deserialize
type is expecting an i16
value.
Hint that the Deserialize
type is expecting an i32
value.
Hint that the Deserialize
type is expecting an i64
value.
Hint that the Deserialize
type is expecting an i128
value. Read more
Hint that the Deserialize
type is expecting a u8
value.
Hint that the Deserialize
type is expecting a u16
value.
Hint that the Deserialize
type is expecting a u32
value.
Hint that the Deserialize
type is expecting a u64
value.
Hint that the Deserialize
type is expecting an u128
value. Read more
Hint that the Deserialize
type is expecting a f32
value.
Hint that the Deserialize
type is expecting a f64
value.
Hint that the Deserialize
type is expecting a char
value.
Hint that the Deserialize
type is expecting a string value and does
not benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
Hint that the Deserialize
type is expecting a string value and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
Hint that the Deserialize
type is expecting a byte array and does not
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
Hint that the Deserialize
type is expecting a byte array and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
Hint that the Deserialize
type is expecting an optional value. Read more
Hint that the Deserialize
type is expecting a unit value.
Hint that the Deserialize
type is expecting a unit struct with a
particular name. Read more
Hint that the Deserialize
type is expecting a sequence of values.
Hint that the Deserialize
type is expecting a sequence of values and
knows how many values there are without looking at the serialized data. Read more
Hint that the Deserialize
type is expecting a tuple struct with a
particular name and number of fields. Read more
Hint that the Deserialize
type is expecting a map of key-value pairs.
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a struct with a particular
name and fields. Read more
Hint that the Deserialize
type is expecting the name of a struct
field or the discriminant of an enum variant. Read more
Hint that the Deserialize
type needs to deserialize a value whose type
doesn’t matter because it is ignored. Read more
Determine whether Deserialize
implementations should expect to
deserialize their human-readable form. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for IObject
impl UnwindSafe for IObject
Blanket Implementations
Mutably borrows from an owned value. Read more