Expand description
An implementation of SF3 (Simple File Format Family) in Rust. See the spec at https://shirakumo.org/docs/sf3
This crate is an experimental work-in-progress still early in the design phase. Expect major breaking changes in the near future.
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);§Crate Features
std(enabled by default) — Enables support for parsing files fromReadtypes, and certain features inchrono,const-str,crc32fast, andhalfwhich require Rust’sstdcrate. All functions work well enough withoutstd, including parsing from byte slices and generating new byte representations of SF3 files, so if you’re writing ano_stdcrate or targeting an environment wherestdisn’t available butallocandcoreare, then you may disable this feature without much consequence.serde— Enablesserdesupport forchrono,half, andmediatypetypes.
Re-exports§
Modules§
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 thanu32::MAXbytes. - 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 thanu64::MAXbytes.