Skip to main content

Reader

Struct Reader 

Source
pub struct Reader { /* private fields */ }

Implementations§

Source§

impl Reader

Source

pub fn open(path: &Path) -> Result<Self>

Source

pub fn superblock(&self) -> &Superblock

Source

pub fn sections(&self) -> &[SectionEntry]

Source

pub fn tracks(&self) -> &[TrackRecord]

Source

pub fn dict(&self) -> &[u32]

Source

pub fn chunks(&self) -> &[ChunkRecord]

Source

pub fn segments(&self) -> &[SegmentRecord]

Source

pub fn meta(&self) -> &[(String, String)]

Source

pub fn integrity(&self) -> &Integrity

Source

pub fn track(&self, track_id: u32) -> Result<&TrackRecord>

Source

pub fn segments_for_track(&self, track_id: u32) -> Vec<&SegmentRecord>

Segments of one track, ordered by presentation time.

Source

pub fn read_chunk_stored(&mut self, index: u32) -> Result<(Vec<u8>, u32, u32)>

Read one chunk payload exactly as stored (possibly zstd-compressed), without decompressing or verifying. Returns (stored bytes, flags, len_raw). Intended for wire passthrough: the receiver decompresses and verifies the BLAKE3 identity against the raw bytes.

Source

pub fn read_chunk(&mut self, index: u32) -> Result<Vec<u8>>

Read, decompress and verify one chunk payload.

Source

pub fn segment_bytes(&mut self, segment: &SegmentRecord) -> Result<Vec<u8>>

Reconstruct a segment payload: ordered concatenation of its chunks.

Source

pub fn track_init_bytes(&mut self, track_id: u32) -> Result<Vec<u8>>

Reconstruct a track’s init payload (e.g. CMAF init segment).

Source

pub fn embedded_signature(&self) -> Option<([u8; 64], [u8; 32])>

Embedded content signature (sig, pubkey) if present, parsed from meta.

Source

pub fn verify_signature(&self) -> Result<SignatureStatus>

Check the embedded Ed25519 content signature, if any. Returns Unsigned when absent, Valid(pubkey) when it verifies, and an error when present but invalid. Callers decide whether the returned pubkey is trusted.

Source

pub fn verify(&mut self) -> Result<VerifyReport>

Full verification: every chunk hash, the Merkle root against the integrity section, and the DATA section hash from the directory.

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> Same for T

Source§

type Output = T

Should always be Self
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.