Struct juniper::Object [−][src]
pub struct Object<S> { /* fields omitted */ }
Expand description
A Object value
Implementations
impl<S> Object<S>
[src]
impl<S> Object<S>
[src]pub fn with_capacity(size: usize) -> Self
[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: AsRef<str> + Into<String>,
[src]
pub fn add_field<K>(&mut self, k: K, value: Value<S>) -> Option<Value<S>> where
K: AsRef<str> + Into<String>,
[src]Add a new field with a value
If there is already a field for the given key any both values are objects, they are merged.
Otherwise the existing value is replaced and returned.
pub fn contains_field<K: AsRef<str>>(&self, k: K) -> bool
[src]
pub fn contains_field<K: AsRef<str>>(&self, k: K) -> bool
[src]Check if the object already contains a field with the given name
pub fn iter(&self) -> impl Iterator<Item = (&String, &Value<S>)>
[src]
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 = (&String, &mut Value<S>)>
[src]
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&String, &mut Value<S>)>
[src]Get a iterator over all mutable field value pairs
pub fn field_count(&self) -> usize
[src]
pub fn field_count(&self) -> usize
[src]Get the current number of fields
Trait Implementations
impl<S> IntoIterator for Object<S>
[src]
impl<S> IntoIterator for Object<S>
[src]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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,