#[non_exhaustive]pub struct Gs1Result { /* private fields */ }Expand description
A parsed GS1 payload: the recovered Gs1Elements plus the original bytes.
Implementations§
Source§impl Gs1Result
impl Gs1Result
Sourcepub fn parse(data: &[u8]) -> Result<Self, ParseError>
pub fn parse(data: &[u8]) -> Result<Self, ParseError>
Parses a GS1 payload (&[u8] with 0x1D separators between
variable-length AIs) into its elements.
Tolerant: unknown AIs are surfaced best-effort rather than rejected, so a payload using an AI outside the curated table still yields elements (with a generic description) instead of failing.
§Errors
Returns ParseError::InvalidFormat only if the input is non-empty but
does not begin with an application-identifier digit.
Sourcepub fn elements(&self) -> &[Gs1Element]
pub fn elements(&self) -> &[Gs1Element]
The recovered application-identifier/value pairs, in order.
Trait Implementations§
impl Eq for Gs1Result
impl StructuralPartialEq for Gs1Result
Auto Trait Implementations§
impl Freeze for Gs1Result
impl RefUnwindSafe for Gs1Result
impl Send for Gs1Result
impl Sync for Gs1Result
impl Unpin for Gs1Result
impl UnsafeUnpin for Gs1Result
impl UnwindSafe for Gs1Result
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