2 unstable releases
0.2.0 | Oct 27, 2024 |
---|---|
0.1.0 | Oct 25, 2024 |
#914 in Parser implementations
242 downloads per month
11KB
130 lines
ydke_parser
A crate for parsing and generating YGOPro deck URLs in the YDKE format.
Example
use ydke_parser::{Deck, parse_url, to_url};
// Create a deck
let deck = Deck {
main: vec![26077387, 37351133],
extra: vec![63288574],
side: vec![37351133],
};
let url1 = "ydke://y+iNAd3uOQI=!/rTFAw==!3e45Ag==!";
// Convert to URL
let url2 = to_url(&deck);
// Parse the URL back into a deck
let parsed_deck1 = parse_url(&url1).unwrap();
let parsed_deck2 = parse_url(&url2).unwrap();
assert_eq!(deck, parsed_deck1);
assert_eq!(deck, parsed_deck2);
lib.rs
:
A crate for parsing and generating YGOPro deck URLs in the YDKE format.
Example
use ydke_parser::{Deck, parse_url, to_url};
// Create a deck
let deck = Deck {
main: vec![26077387, 37351133],
extra: vec![63288574],
side: vec![37351133],
};
let url1 = "ydke://y+iNAd3uOQI=!/rTFAw==!3e45Ag==!";
// Convert deck to URL
let url2 = to_url(&deck);
// Parse the URL back into a deck
let parsed_deck1 = parse_url(&url1).unwrap();
let parsed_deck2 = parse_url(&url2).unwrap();
assert_eq!(deck, parsed_deck1);
assert_eq!(deck, parsed_deck2);
Dependencies
~0.5–1MB
~21K SLoC