Crate arrowvortex_clipboard

Source
Expand description

Small library for encoding and decoding ArrowVortex clipboard data. Ported from av-clipboard-lib, a Python libary by DeltaEpsilon.

Main credit goes to DeltaEpsilon for reverse-engineering ArrowVortex’ clipboard functions and implementing the first ArrowVortex clipboard library.

// EtternaOnline noteskin template pattern (https://etternaonline.com/noteskins)
let data = r#"ArrowVortex:notes:!"8i-K)chjJHuM^!#P_Z![IjrJi#:bJ2UO3!BC3L"%E"#;

// Decode string into Vec<Note>
let notes = match arrowvortex_clipboard::decode(data.as_bytes())? {
    arrowvortex_clipboard::DecodeResult::RowBasedNotes(notes) => notes,
    _ => panic!("Unexpected data type"),
};
println!("{:?}", notes);

// Encode &[Note] into string
let buffer = arrowvortex_clipboard::encode_row_based_notes(&notes)?;
println!("{}", buffer);

// Verify that string stayed identical after roundtrip
assert_eq!(data, buffer);

Structs§

Enums§

Functions§