Archive

Struct Archive 

Source
pub struct Archive { /* private fields */ }
Expand description

Archive for reading/writing AGC data

Implementations§

Source§

impl Archive

Source

pub fn new_reader() -> Self

Create a new archive in input (read) mode

Source

pub fn new_writer() -> Self

Create a new archive in output (write) mode

Source

pub fn open<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Open an archive file

Source

pub fn close(&mut self) -> Result<()>

Close the archive (writes footer in write mode)

Source

pub fn register_stream(&mut self, stream_name: &str) -> usize

Register a new stream and return its ID

Source

pub fn get_stream_id(&self, stream_name: &str) -> Option<usize>

Get stream ID by name (returns None if not found)

Source

pub fn get_stream_names(&self) -> Vec<String>

Get list of all stream names

Source

pub fn add_part( &mut self, stream_id: usize, data: &[u8], metadata: u64, ) -> Result<()>

Add a part to a stream

Source

pub fn add_part_buffered( &mut self, stream_id: usize, data: Vec<u8>, metadata: u64, )

Buffer a part for later writing (C++ AGC: AddPartBuffered) This allows parallel compression while maintaining deterministic write order. Call flush_buffers() after all parts are buffered to write in sorted stream_id order.

Source

pub fn flush_buffers(&mut self) -> Result<()>

Flush all buffered parts to disk in sorted stream_id order (C++ AGC: flush_out_buffers) This ensures deterministic output regardless of which thread buffered the data.

Source

pub fn set_raw_size(&mut self, stream_id: usize, raw_size: u64)

Set raw (uncompressed) size for a stream

Source

pub fn get_raw_size(&self, stream_id: usize) -> u64

Get raw size for a stream

Source

pub fn get_packed_size(&self, stream_id: usize) -> u64

Get packed (compressed) size for a stream

Source

pub fn get_packed_data_size(&self, stream_id: usize) -> u64

Get packed data size (compressed data only, without metadata)

Source

pub fn get_stream_name(&self, stream_id: usize) -> Option<&str>

Get stream name by ID

Source

pub fn get_num_streams(&self) -> usize

Get number of streams

Source

pub fn get_num_parts(&self, stream_id: usize) -> usize

Get number of parts in a stream

Source

pub fn get_part(&mut self, stream_id: usize) -> Result<Option<(Vec<u8>, u64)>>

Get the next part from a stream (sequential reading)

Source

pub fn get_part_by_id( &mut self, stream_id: usize, part_id: usize, ) -> Result<(Vec<u8>, u64)>

Get a specific part by ID from a stream (random access)

Trait Implementations§

Source§

impl Drop for Archive

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.