pub struct RegionLayout { /* private fields */ }Expand description
An ordered description of a synthesized virtual file: the metadata region
(inline framing + art images) followed by the backing audio. Totals are
computed once at construction; segments is private so they cannot desync.
Implementations§
Source§impl RegionLayout
impl RegionLayout
pub fn validated(segments: Vec<Segment>) -> Result<RegionLayout, LayoutError>
Sourcepub fn segments(&self) -> &[Segment]
pub fn segments(&self) -> &[Segment]
The ordered segments composing the synthesized virtual file.
Sourcepub fn has_binary_tag(&self) -> bool
pub fn has_binary_tag(&self) -> bool
True if any segment streams an opaque binary tag payload from the DB.
Sourcepub fn streams_db_rowid(&self) -> bool
pub fn streams_db_rowid(&self) -> bool
True if any segment is streamed from the DB by a rowid at read time —
BinaryTag (a tags rowid), ArtImage, or OggArtSlice (both an art
rowid). These are the segments exposed to the rowid-reuse hazard (a
concurrent delete + reinsert reusing a freed rowid), so the serve path
must read them under a single WAL snapshot with a content_version
recheck. BackingAudio/OggAudio/Inline carry no DB rowid.
Sourcepub fn total_len(&self) -> u64
pub fn total_len(&self) -> u64
Total size of the synthesized virtual file in bytes (stored at construction).
Sourcepub fn header_len(&self) -> u64
pub fn header_len(&self) -> u64
Size of the synthesized metadata region preceding the backing audio (stored).
Sourcepub fn validate(&self) -> Result<(), LayoutError>
pub fn validate(&self) -> Result<(), LayoutError>
Validate basic producer invariants. Returns Ok(()) if the layout is
structurally sound (no empty metadata segments, lengths don’t overflow).
Zero-length backing audio is valid for formats that can represent an
empty media payload.
Trait Implementations§
Source§impl Clone for RegionLayout
impl Clone for RegionLayout
Source§fn clone(&self) -> RegionLayout
fn clone(&self) -> RegionLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegionLayout
impl Debug for RegionLayout
impl Eq for RegionLayout
Source§impl PartialEq for RegionLayout
impl PartialEq for RegionLayout
Source§fn eq(&self, other: &RegionLayout) -> bool
fn eq(&self, other: &RegionLayout) -> bool
self and other values to be equal, and is used by ==.