Crates.io | ydke_parser |
lib.rs | ydke_parser |
version | 0.2.0 |
source | src |
created_at | 2024-10-25 19:03:07.819006 |
updated_at | 2024-10-27 06:05:26.746781 |
description | A parser for YGOPro deck URLs in the YDKE format |
homepage | |
repository | https://github.com/Satellaa/ydke_parser |
max_upload_size | |
id | 1422827 |
size | 28,916 |
A crate for parsing and generating YGOPro deck URLs in the YDKE format.
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);