pub struct Group<'a> { /* private fields */ }Expand description
A zero-copy view over one repeating-group instance.
Borrows a sub-slice of the parent Message’s offset array and the raw
input buffer. Field access is identical to Message: zero allocation,
zero copy.
Implementations§
Source§impl<'a> Group<'a>
impl<'a> Group<'a>
Sourcepub fn field(&self, index: usize) -> Field<'a>
pub fn field(&self, index: usize) -> Field<'a>
Returns the field at index. Panics if index >= self.len().
Sourcepub fn fields(&self) -> impl Iterator<Item = Field<'a>> + '_
pub fn fields(&self) -> impl Iterator<Item = Field<'a>> + '_
Iterates over all fields in this group instance.
Sourcepub fn find(&self, tag: Tag) -> Option<Field<'a>>
pub fn find(&self, tag: Tag) -> Option<Field<'a>>
Returns the first field with the given tag, or None.
Sourcepub fn groups(&self, spec: &GroupSpec) -> GroupIter<'a> ⓘ
pub fn groups(&self, spec: &GroupSpec) -> GroupIter<'a> ⓘ
Return an iterator over the instances of a repeating group nested inside
this group instance. Mirrors [Message::groups] exactly.
Because this group’s offsets slice is already bounded to this parent
instance, the nested iterator cannot escape into sibling parent instances.
Returns an empty iterator if the nested count tag is absent or zero.
Trait Implementations§
impl<'a> Copy for Group<'a>
Auto Trait Implementations§
impl<'a> Freeze for Group<'a>
impl<'a> RefUnwindSafe for Group<'a>
impl<'a> Send for Group<'a>
impl<'a> Sync for Group<'a>
impl<'a> Unpin for Group<'a>
impl<'a> UnsafeUnpin for Group<'a>
impl<'a> UnwindSafe for Group<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more