pub struct StreamingBundle { /* private fields */ }Expand description
A bundle opened from just its structural prefix, with payload bytes arriving incrementally as HTTP range responses.
The prefix must span at least [0, dataOffset) — header, metadata, index,
and dictionary. Callers then ask missing_group_span which byte range a
frame’s temporal group still needs, fetch it, and hand it to
insert_range; the writer keeps each group’s payloads contiguous, so
one range request per group suffices.
Implementations§
Source§impl StreamingBundle
impl StreamingBundle
pub fn open_prefix(prefix: &[u8]) -> Result<Self, DecodeError>
pub fn metadata_json(&self) -> &str
pub fn plane_length(&self) -> usize
pub fn frame_count(&self) -> u32
pub fn variable_ids(&self) -> &[u8] ⓘ
Sourcepub fn unit_seconds(&self) -> u32
pub fn unit_seconds(&self) -> u32
Seconds per axis unit: a frame’s valid time is
runTime + frameOffset * unitSeconds.
Sourcepub fn frame_offsets(&self) -> &[u16]
pub fn frame_offsets(&self) -> &[u16]
The materialized frame-offset axis, ascending — the keys every plane of every variable is addressed by.
pub fn clear_cache(&mut self)
Sourcepub fn tile_geometry(&self) -> Option<TileGeometry>
pub fn tile_geometry(&self) -> Option<TileGeometry>
The file’s tiling, or None for a plane-major v1 file.
Sourcepub fn data_offset(&self) -> u64
pub fn data_offset(&self) -> u64
End of the structural prefix: the minimum bytes open_prefix needs.
pub fn file_size(&self) -> u64
Sourcepub fn total_payload_bytes(&self) -> u64
pub fn total_payload_bytes(&self) -> u64
Sum of every payload’s compressed length.
Sourcepub fn resident_payload_bytes(&self) -> u64
pub fn resident_payload_bytes(&self) -> u64
Compressed bytes inserted so far.
Sourcepub fn missing_group_span(
&self,
request: FrameRequest,
) -> Result<Option<(u64, u64)>, DecodeError>
pub fn missing_group_span( &self, request: FrameRequest, ) -> Result<Option<(u64, u64)>, DecodeError>
The contiguous byte span [start, end) still needed to decode any
frame of the temporal group containing request, or None when the
whole group is already resident.
This is the global-view request in both versions, and it stays one range in both: v1 keeps a variable’s group adjacent, v2 keeps a whole group — every tile, every variable — adjacent.
Sourcepub fn missing_spans(
&self,
request: FrameRequest,
tiles: Option<TileRect>,
) -> Result<Vec<(u64, u64)>, DecodeError>
pub fn missing_spans( &self, request: FrameRequest, tiles: Option<TileRect>, ) -> Result<Vec<(u64, u64)>, DecodeError>
The byte spans a frame still needs, restricted to a tile rectangle and coalesced where the tiles are adjacent in the file — one span per tile row per group, since a row of tiles is contiguous.
Sourcepub fn missing_series_spans(
&self,
variable_id: u8,
column: u32,
row: u32,
) -> Result<Vec<(u64, u64)>, DecodeError>
pub fn missing_series_spans( &self, variable_id: u8, column: u32, row: u32, ) -> Result<Vec<(u64, u64)>, DecodeError>
The spans one cell’s series still needs: one chunk per group, so at most one span per group and nothing proportional to the frame count.
Sourcepub fn insert_range(
&mut self,
offset: u64,
bytes: &[u8],
) -> Result<(), DecodeError>
pub fn insert_range( &mut self, offset: u64, bytes: &[u8], ) -> Result<(), DecodeError>
Store payload bytes covering [offset, offset + bytes.len()) of the
file. Every index entry whose payload lies fully inside the range
becomes resident; partial overlaps are ignored.
pub fn decode_frame( &mut self, request: FrameRequest, ) -> Result<&[u8], DecodeError>
Sourcepub fn decode_frame_tiles(
&mut self,
request: FrameRequest,
tiles: TileRect,
) -> Result<&[u8], DecodeError>
pub fn decode_frame_tiles( &mut self, request: FrameRequest, tiles: TileRect, ) -> Result<&[u8], DecodeError>
Decode only the tiles a viewport covers; see Bundle::decode_frame_tiles.
Sourcepub fn decode_series(
&mut self,
variable_id: u8,
column: u32,
row: u32,
) -> Result<Vec<u8>, DecodeError>
pub fn decode_series( &mut self, variable_id: u8, column: u32, row: u32, ) -> Result<Vec<u8>, DecodeError>
One cell’s code on every frame of the axis, in axis order.
Auto Trait Implementations§
impl Forget for StreamingBundle
impl Freeze for StreamingBundlewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<u16>: Freeze,
PhantomData<PlaneEntry>: Freeze,
PhantomData<(FrameRequest, usize)>: Freeze,
PhantomData<VariableEntry>: Freeze,
PhantomData<GroupEntry>: Freeze,
PhantomData<ChunkEntry>: Freeze,
PhantomData<u64>: Freeze,
PhantomData<(u32, u32)>: Freeze,
PhantomData<Option<Vec<u8>>>: Freeze,
PhantomData<(FrameRequest, Vec<u8>)>: Freeze,
PhantomData<(usize, Vec<u8>)>: Freeze,
impl Move for StreamingBundle
impl RefUnwindSafe for StreamingBundle
impl Send for StreamingBundle
impl Sync for StreamingBundle
impl Unpin for StreamingBundle
impl UnsafeUnpin for StreamingBundlewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<u16>: UnsafeUnpin,
PhantomData<PlaneEntry>: UnsafeUnpin,
PhantomData<(FrameRequest, usize)>: UnsafeUnpin,
PhantomData<VariableEntry>: UnsafeUnpin,
PhantomData<GroupEntry>: UnsafeUnpin,
PhantomData<ChunkEntry>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<(u32, u32)>: UnsafeUnpin,
PhantomData<Option<Vec<u8>>>: UnsafeUnpin,
PhantomData<(FrameRequest, Vec<u8>)>: UnsafeUnpin,
PhantomData<(usize, Vec<u8>)>: UnsafeUnpin,
impl UnwindSafe for StreamingBundlewhere
RawVecInner: UnwindSafe,
HashMap<FrameRequest, usize>: UnwindSafe,
HashMap<FrameRequest, Vec<u8>>: UnwindSafe,
HashMap<usize, Vec<u8>>: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more