Crate sf3

Crate sf3 

Source
Expand description

An implementation of SF3 (Simple File Format Family) in Rust. See the spec at https://shirakumo.org/docs/sf3

This crate is experimental, and a work-in-progress. Expect major breaking changes until v1.0.

This crate provides structures for working with SF3 files. Several formats are currently implemented, including:

More are on the way! See the complete list the specification supports at https://shirakumo.org/docs/sf3/specification.html#formats

use sf3::file::Sf3File;
use sf3::Archive;

let archive_bytes: &[u8] = include_bytes!("../tests/archive/multi-text.ar.sf3"); // get this data from anywhere
let archive = Archive::parse_bytes(archive_bytes).unwrap();
assert_eq!(archive.payload.len(), 2);

Re-exports§

pub use archive::Archive;
pub use audio::Audio;
pub use text::Text;

Modules§

archive
audio
error
file
text
util

Macros§

cstring
Converts a string literal into a [CString<L>]. A null byte is added before computing the string length. The program will not compile if the given value, plus a null byte, is larger than the given capacity.
cstring8
Converts a string literal into a [CString8]. A null byte is added before computing the string length. The program will not compile if the given value, plus a null byte, is larger than 255 bytes.
cstring16
Converts a string literal into a [CString16]. A null byte is added before computing the string length. The program will not compile if the given value, plus a null byte, is larger than 65,535 bytes.
cstring32
Converts a string literal into a [CString32]. A null byte is added before computing the string length. The program will not compile if the given value, plus a null byte, is larger than u32::MAX bytes.
cstring64
Converts a string literal into a [CString64]. A null byte is added before computing the string length. The program will not compile if the given value, plus a null byte, is larger than u64::MAX bytes.