[−][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) -> 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]
&'a str: PartialEq<K>,
Get the value for a given field
Trait Implementations
impl<S: Clone> Clone for Object<S>
[src]
impl<S: Debug> Debug for Object<S>
[src]
impl<S> From<Object<S>> for Value<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<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: PartialEq> PartialEq<Object<S>> for Object<S>
[src]
impl<T> Serialize for Object<T> where
T: Serialize,
[src]
T: Serialize,
impl<S> StructuralPartialEq for Object<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Object<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Object<S> where
S: Send,
S: Send,
impl<S> Sync for Object<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Object<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Object<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,