[−][src]Struct juniper::Object
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]
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]
&'a str: PartialEq<K>,
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]
&'a str: PartialEq<K>,
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<S: Clone> Clone for Object<S>
[src]
fn clone(&self) -> 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]
K: Into<String>,
&'a str: PartialEq<K>,
impl<T> Serialize for Object<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
Blanket Implementations
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,