[][src]Struct juniper::Object

pub struct Object<S> { /* fields omitted */ }

A Object value

Methods

impl<S> Object<S>[src]

pub fn with_capacity(size: usize) -> Self[src]

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<S>) -> Option<Value<S>> where
    K: Into<String>,
    &'a str: PartialEq<K>, 
[src]

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]

Check if the object already contains a field with the given name

pub fn iter(&self) -> FieldIter<S>[src]

Get a iterator over all field value pairs

This method returns a iterator over &'a (String, Value)

pub fn iter_mut(&mut self) -> FieldIterMut<S>[src]

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]

Get the current number of fields

pub fn get_field_value<K>(&self, key: K) -> Option<&Value<S>> where
    &'a str: PartialEq<K>, 
[src]

Get the value for a given field

Trait Implementations

impl<S: PartialEq> PartialEq<Object<S>> for Object<S>[src]

impl<S> IntoIterator for Object<S>[src]

type Item = (String, Value<S>)

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

impl<S: Clone> Clone for Object<S>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S> From<Object<S>> for Value<S>[src]

impl<S: Debug> Debug for Object<S>[src]

impl<K, S> FromIterator<(K, Value<S>)> for Object<S> where
    K: Into<String>,
    &'a str: PartialEq<K>, 
[src]

impl<T> Serialize for Object<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<S> Send for Object<S> where
    S: Send

impl<S> Sync for Object<S> where
    S: Sync

Blanket Implementations

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]