pub struct DigitalLink {
pub resolver_base: String,
pub gtin: Gtin,
pub variant: Option<String>,
pub batch: Option<String>,
pub serial: Option<String>,
pub tpcsn: Option<String>,
}Fields§
§resolver_base: StringBase resolver URL including any path prefix before the /01/ segment
(e.g. https://id.odal-node.io or https://example.com/resolve).
gtin: GtinValidated 14-digit GTIN.
variant: Option<String>Consumer product variant (AI 22).
batch: Option<String>Batch / lot number (AI 10).
serial: Option<String>Serial number (AI 21).
tpcsn: Option<String>Third-party controlled serial number (AI 235).
Implementations§
Source§impl DigitalLink
impl DigitalLink
Sourcepub fn parse(uri: &str) -> Result<Self, DigitalLinkError>
pub fn parse(uri: &str) -> Result<Self, DigitalLinkError>
Parse a GS1 Digital Link URI.
Accepted forms:
https://id.odal-node.io/01/09506000134352/21/ABC123https://id.odal-node.io/01/09506000134352/10/BATCH01/21/SN001https://example.com/resolve/01/09506000134352/21/SN001(path prefix)
GTIN-8 / GTIN-12 / GTIN-13 are normalised to 14 digits by left-padding.
Unknown AI codes produce UnknownApplicationIdentifier.
Qualifiers out of canonical order produce QualifiersOutOfOrder.
Trait Implementations§
Source§impl Clone for DigitalLink
impl Clone for DigitalLink
Source§fn clone(&self) -> DigitalLink
fn clone(&self) -> DigitalLink
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DigitalLink
impl Debug for DigitalLink
Source§impl PartialEq for DigitalLink
impl PartialEq for DigitalLink
impl StructuralPartialEq for DigitalLink
Auto Trait Implementations§
impl Freeze for DigitalLink
impl RefUnwindSafe for DigitalLink
impl Send for DigitalLink
impl Sync for DigitalLink
impl Unpin for DigitalLink
impl UnsafeUnpin for DigitalLink
impl UnwindSafe for DigitalLink
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