pub struct Writer { /* private fields */ }Implementations§
Source§impl Writer
impl Writer
Sourcepub fn create(
path: &Path,
asset_uuid: [u8; 16],
timescale: u32,
compress: bool,
) -> Result<Self>
pub fn create( path: &Path, asset_uuid: [u8; 16], timescale: u32, compress: bool, ) -> Result<Self>
Create a new CAVS-1 file at path. compress enables per-chunk zstd
(chunks that don’t shrink are stored raw regardless).
Sourcepub fn set_zstd_level(&mut self, level: i32)
pub fn set_zstd_level(&mut self, level: i32)
zstd level for chunk storage/wire compression (default 3).
Sourcepub fn sign_with(&mut self, secret: &[u8; 32])
pub fn sign_with(&mut self, secret: &[u8; 32])
Sign the packed content with this Ed25519 secret key. The signature
(over the canonical content message, see
cavs_hash::content_signature_message) and the public key are
embedded as sig.ed25519 / sig.pubkey meta entries at finish().
Sourcepub fn add_chunk(&mut self, raw: &[u8]) -> Result<u32>
pub fn add_chunk(&mut self, raw: &[u8]) -> Result<u32>
Add one chunk payload. Returns its chunk-table index. Duplicate payloads (same BLAKE3) are not stored again.
pub fn add_track(&mut self, track: TrackRecord) -> Result<()>
pub fn add_segment(&mut self, segment: SegmentRecord) -> Result<()>
Sourcepub fn pin_dict(&mut self, chunk_index: u32) -> Result<()>
pub fn pin_dict(&mut self, chunk_index: u32) -> Result<()>
Mark a chunk as part of the global dictionary (privileged reuse: init segments, bootstrap assets, shared headers…).
pub fn set_meta(&mut self, key: &str, value: &str)
pub fn chunk_count(&self) -> u32
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnsafeUnpin for Writer
impl UnwindSafe for Writer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more