9 releases
0.3.1 | Dec 23, 2018 |
---|---|
0.3.0 | Dec 11, 2018 |
0.2.1 | Dec 10, 2018 |
0.1.4 | Dec 7, 2018 |
#29 in #deck
22 downloads per month
Used in artifact_lib
19KB
389 lines
artifact_serde
A small Rust library for serializing/deserialzing Artifact Decks and Deck Codes. Created to support my other Rust Artifact library, but still provides its own use case for others.
Usage
To install, add to Cargo.toml
[dependencies]
artifact_serde = "0.3.0"
If you are still on rust version < 1.31.0 you will need to add this to your crate root
extern crate artifact_serde
Basic usage example
fn main() {
let adc = "ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__";
let mut my_deck = artifact_serde::decode(&adc).unwrap();
// Should return a new String that is the same as the initial ADC
let my_serialized_adc = artifact_serde::encode(&mut my_deck).unwrap();
}
my_deck
will be an instance of DeserializedDeck
, by itself it is not too useful, as you will still need to map the
card ids to their respective cards. This is handled in my other library, but if you wish to use this on its own follow
the instructions provided by Valve which is described in detail here
Dependencies
~3.5–9.5MB
~118K SLoC