Struct pdl_compiler::lint::PacketScope
source · pub struct PacketScope<'d> {
pub all_fields: HashMap<String, &'d Field>,
pub all_constraints: HashMap<String, &'d Constraint>,
/* private fields */
}
Expand description
Gather information about a Packet, Struct, or Group declaration.
Fields§
§all_fields: HashMap<String, &'d Field>
§all_constraints: HashMap<String, &'d Constraint>
Implementations§
source§impl<'d> PacketScope<'d>
impl<'d> PacketScope<'d>
sourcepub fn iter_fields(&self) -> impl Iterator<Item = &'d Field>
pub fn iter_fields(&self) -> impl Iterator<Item = &'d Field>
Iterate over the packet’s fields.
sourcepub fn get_packet_field(&self, id: &str) -> Option<&Field>
pub fn get_packet_field(&self, id: &str) -> Option<&Field>
Lookup a field by name. This will also find the special
_payload_
and _body_
fields.
sourcepub fn get_payload_field(&self) -> Option<&Field>
pub fn get_payload_field(&self) -> Option<&Field>
Find the payload or body field, if any.
sourcepub fn get_array_size_field(&self, id: &str) -> Option<&Field>
pub fn get_array_size_field(&self, id: &str) -> Option<&Field>
Lookup the size field for an array field.
sourcepub fn get_payload_size_field(&self) -> Option<&Field>
pub fn get_payload_size_field(&self) -> Option<&Field>
Find the size field corresponding to the payload or body field of this packet.
Trait Implementations§
Auto Trait Implementations§
impl<'d> RefUnwindSafe for PacketScope<'d>
impl<'d> Send for PacketScope<'d>
impl<'d> Sync for PacketScope<'d>
impl<'d> Unpin for PacketScope<'d>
impl<'d> UnwindSafe for PacketScope<'d>
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