Struct async_graphql::dynamic::ListAccessor
source · pub struct ListAccessor<'a>(_);
Available on crate feature
dynamic-schema
only.Expand description
A list accessor
Implementations§
source§impl<'a> ListAccessor<'a>
impl<'a> ListAccessor<'a>
sourcepub fn iter(&'a self) -> impl Iterator<Item = ValueAccessor<'_>> + 'a
pub fn iter(&'a self) -> impl Iterator<Item = ValueAccessor<'_>> + 'a
Returns an iterator over the list
sourcepub fn get(&self, idx: usize) -> Option<ValueAccessor<'a>>
pub fn get(&self, idx: usize) -> Option<ValueAccessor<'a>>
Returns a reference to an element depending on the index
sourcepub fn try_get(&self, idx: usize) -> Result<ValueAccessor<'a>>
pub fn try_get(&self, idx: usize) -> Result<ValueAccessor<'a>>
Like ListAccessor::get
, returns Err
if the index does not exist