Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abiriadev/digital-link-rs

GS1 Digital Link implementation for Rust
https://github.com/abiriadev/digital-link-rs

digital-link gs1 gs1-digital-link implementation rust

Last synced: about 1 month ago
JSON representation

GS1 Digital Link implementation for Rust

Awesome Lists containing this project

README

        

# Digital Link for Rust

[see gs1 digital link specification](https://www.gs1us.org/industries-and-insights/standards/gs1-digital-link)

## Example

```rs
use digital_link_rs::{self, DigitalLink, Gs1Path};

fn main() {
let digital_link = DigitalLink::try_from_str("https://id.gs1.org/00/195201234567891232?02=09520123456788&37=25&10=ABC12&17=180426").expect("parsing error");

if let Gs1Path::Sscc(sscc) = digital_link.gs1_path {
println!("sscc: {sscc}");
}

if let Some(date) = digital_link.data_attributes.expiry_date {
println!("expiry date: {date}");
}
}
```