Struct async_graphql::dynamic::ObjectAccessor
source · pub struct ObjectAccessor<'a>(_);
Available on crate feature
dynamic-schema
only.Expand description
A object accessor
Implementations§
source§impl<'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