Struct juniper::Object [−][src]
pub struct Object { /* fields omitted */ }A Object value
Methods
impl Object[src]
impl Objectpub fn with_capacity(size: usize) -> Self[src]
pub fn with_capacity(size: usize) -> SelfCreate 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) -> FieldIterGet 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) -> FieldIterMutGet 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) -> usizeGet 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 Objectfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Object[src]
impl PartialEq for Objectfn eq(&self, other: &Object) -> bool[src]
fn eq(&self, other: &Object) -> boolThis 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) -> boolThis method tests for !=.
impl Clone for Object[src]
impl Clone for Objectfn clone(&self) -> Object[src]
fn clone(&self) -> ObjectReturns 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 Objecttype 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::IntoIterCreates an iterator from a value. Read more
impl From<Object> for Value[src]
impl From<Object> for Valueimpl<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