Struct async_graphql::dynamic::ObjectAccessor
source · pub struct ObjectAccessor<'a>(_);
Available on crate feature
dynamic-schema
only.Expand description
A object accessor
Implementations
sourceimpl<'a> ObjectAccessor<'a>
impl<'a> ObjectAccessor<'a>
sourcepub fn get(&'a self, name: &str) -> Option<ValueAccessor<'a>>
pub fn get(&'a self, name: &str) -> Option<ValueAccessor<'a>>
Return a reference to the value stored for key
, if it is present,
else None
.
sourcepub fn try_get(&'a self, name: &str) -> Result<ValueAccessor<'a>>
pub fn try_get(&'a self, name: &str) -> Result<ValueAccessor<'a>>
Like ObjectAccessor::get
, returns Err
if the index does not exist
sourcepub fn iter(
&'a self
) -> impl Iterator<Item = (&'_ Name, ValueAccessor<'_>)> + 'a
pub fn iter(
&'a self
) -> impl Iterator<Item = (&'_ Name, ValueAccessor<'_>)> + 'a
Return an iterator over the key-value pairs of the object, in their order
Auto Trait Implementations
impl<'a> RefUnwindSafe for ObjectAccessor<'a>
impl<'a> Send for ObjectAccessor<'a>
impl<'a> Sync for ObjectAccessor<'a>
impl<'a> Unpin for ObjectAccessor<'a>
impl<'a> UnwindSafe for ObjectAccessor<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more