[][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) -> impl Iterator<Item = &(String, Value<S>)>[src]

Get a iterator over all field value pairs

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut (String, Value<S>)>[src]

Get a iterator over all mutable field value pairs

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> From<Object<S>> for Value<S>[src]

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

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> 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: 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> Unpin for Object<S> where
    S: Unpin

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

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

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

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

Blanket Implementations

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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