pub struct DecodedPacket<'db, 'p> { /* private fields */ }Expand description
The result of decoding one packet.
Values are kept in decode order. If a parameter is decoded more than once — which an entry list can do — the later value replaces the earlier one in place, so the packet reads as a map with stable ordering, exactly as the reference implementation’s dict does.
Implementations§
Source§impl<'db, 'p> DecodedPacket<'db, 'p>
impl<'db, 'p> DecodedPacket<'db, 'p>
Sourcepub fn container(&self) -> ContainerId
pub fn container(&self) -> ContainerId
The most derived container that matched.
Sourcepub fn bits_consumed(&self) -> usize
pub fn bits_consumed(&self) -> usize
Bits consumed by the entry lists that ran.
Sourcepub fn trailing_bits(&self) -> isize
pub fn trailing_bits(&self) -> isize
Bits in the packet that no entry claimed.
Non-zero is not an error — the reference implementation only warns — but it usually means the definition and the packet disagree, so it is worth surfacing.
Sourcepub fn values(&self) -> &[ParameterValue<'db, 'p>]
pub fn values(&self) -> &[ParameterValue<'db, 'p>]
Decoded values, in decode order.
Sourcepub fn get(&self, parameter: ParamId) -> Option<&ParameterValue<'db, 'p>>
pub fn get(&self, parameter: ParamId) -> Option<&ParameterValue<'db, 'p>>
A decoded value by parameter id.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&ParameterValue<'db, 'p>>
pub fn get_by_name(&self, name: &str) -> Option<&ParameterValue<'db, 'p>>
A decoded value by parameter name.
Sourcepub fn iter_named(
&self,
) -> impl Iterator<Item = (&'db str, &ParameterValue<'db, 'p>)>
pub fn iter_named( &self, ) -> impl Iterator<Item = (&'db str, &ParameterValue<'db, 'p>)>
Iterates (name, value) pairs in decode order.
Trait Implementations§
Auto Trait Implementations§
impl<'db, 'p> Forget for DecodedPacket<'db, 'p>
impl<'db, 'p> Freeze for DecodedPacket<'db, 'p>
impl<'db, 'p> Move for DecodedPacket<'db, 'p>
impl<'db, 'p> RefUnwindSafe for DecodedPacket<'db, 'p>
impl<'db, 'p> Send for DecodedPacket<'db, 'p>
impl<'db, 'p> Sync for DecodedPacket<'db, 'p>
impl<'db, 'p> Unpin for DecodedPacket<'db, 'p>
impl<'db, 'p> UnsafeUnpin for DecodedPacket<'db, 'p>
impl<'db, 'p> UnwindSafe for DecodedPacket<'db, 'p>
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