Struct juniper::Object [−][src]
pub struct Object { /* fields omitted */ }
A Object value
Methods
impl Object
[src]
impl Object
pub fn with_capacity(size: usize) -> Self
[src]
pub fn with_capacity(size: usize) -> Self
Create a new Object value with a fixed number of preallocated slots for field-value pairs
pub fn add_field<K>(&mut self, k: K, value: Value) -> Option<Value> where
K: Into<String>,
&'a str: PartialEq<K>,
[src]
pub fn add_field<K>(&mut self, k: K, value: Value) -> Option<Value> where
K: Into<String>,
&'a str: PartialEq<K>,
Add a new field with a value
If there is already a field with the same name the old value is returned
pub fn contains_field<K>(&self, f: K) -> bool where
&'a str: PartialEq<K>,
[src]
pub fn contains_field<K>(&self, f: K) -> bool where
&'a str: PartialEq<K>,
Check if the object already contains a field with the given name
pub fn iter(&self) -> FieldIter
[src]
pub fn iter(&self) -> FieldIter
Get a iterator over all field value pairs
This method returns a iterator over &'a (String, Value)
pub fn iter_mut(&mut self) -> FieldIterMut
[src]
pub fn iter_mut(&mut self) -> FieldIterMut
Get a iterator over all mutable field value pairs
This method returns a iterator over &mut 'a (String, Value)
pub fn field_count(&self) -> usize
[src]
pub fn field_count(&self) -> usize
Get the current number of fields
pub fn get_field_value<K>(&self, key: K) -> Option<&Value> where
&'a str: PartialEq<K>,
[src]
pub fn get_field_value<K>(&self, key: K) -> Option<&Value> where
&'a str: PartialEq<K>,
Get the value for a given field
Trait Implementations
impl Debug for Object
[src]
impl Debug for Object
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Object
[src]
impl PartialEq for Object
fn eq(&self, other: &Object) -> bool
[src]
fn eq(&self, other: &Object) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Object) -> bool
[src]
fn ne(&self, other: &Object) -> bool
This method tests for !=
.
impl Clone for Object
[src]
impl Clone for Object
fn clone(&self) -> Object
[src]
fn clone(&self) -> Object
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl IntoIterator for Object
[src]
impl IntoIterator for Object
type Item = (String, Value)
The type of the elements being iterated over.
type IntoIter = IntoIter<Self::Item>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl From<Object> for Value
[src]
impl From<Object> for Value
impl<K> FromIterator<(K, Value)> for Object where
K: Into<String>,
&'a str: PartialEq<K>,
[src]
impl<K> FromIterator<(K, Value)> for Object where
K: Into<String>,
&'a str: PartialEq<K>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (K, Value)>,
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (K, Value)>,
Creates a value from an iterator. Read more
impl Serialize for Object
[src]
impl Serialize for Object