pub fn decode(data: &[u8]) -> Result<DecodeResult, DecodeError>Expand description
Decodes a byte buffer into an iterator of Note
use arrowvortex_clipboard::{Note, NoteKind};
let data = br#"ArrowVortex:notes:!!E9%!=T#H"!d"#;
let notes = match arrowvortex_clipboard::decode(data)? {
arrowvortex_clipboard::DecodeResult::RowBasedNotes(notes) => notes,
_ => panic!("Unexpected data type"),
};
assert_eq!(¬es, &[
Note { pos: 0, column: 0, kind: NoteKind::Tap },
Note { pos: 12, column: 1, kind: NoteKind::Tap },
Note { pos: 24, column: 2, kind: NoteKind::Tap },
Note { pos: 36, column: 3, kind: NoteKind::Tap },
]);