Skip to main content

StreamingBundle

Struct StreamingBundle 

Source
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

Source

pub fn open_prefix(prefix: &[u8]) -> Result<Self, DecodeError>

Source

pub fn metadata_json(&self) -> &str

Source

pub fn plane_length(&self) -> usize

Source

pub fn frame_count(&self) -> u32

Source

pub fn variable_ids(&self) -> &[u8] ⓘ

Source

pub fn unit_seconds(&self) -> u32

Seconds per axis unit: a frame’s valid time is runTime + frameOffset * unitSeconds.

Source

pub fn frame_offsets(&self) -> &[u16]

The materialized frame-offset axis, ascending — the keys every plane of every variable is addressed by.

Source

pub fn clear_cache(&mut self)

Source

pub fn tile_geometry(&self) -> Option<TileGeometry>

The file’s tiling, or None for a plane-major v1 file.

Source

pub fn data_offset(&self) -> u64

End of the structural prefix: the minimum bytes open_prefix needs.

Source

pub fn file_size(&self) -> u64

Source

pub fn total_payload_bytes(&self) -> u64

Sum of every payload’s compressed length.

Source

pub fn resident_payload_bytes(&self) -> u64

Compressed bytes inserted so far.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn decode_frame( &mut self, request: FrameRequest, ) -> Result<&[u8], DecodeError>

Source

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.

Source

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 StreamingBundle

§

impl Move for StreamingBundle

§

impl RefUnwindSafe for StreamingBundle

§

impl Send for StreamingBundle
where RawVecInner: Send, RawTable<(FrameRequest, usize)>: Send, RawTable<(FrameRequest, Vec<u8>)>: Send, RawTable<(usize, Vec<u8>)>: Send,

§

impl Sync for StreamingBundle
where RawVecInner: Sync, RawTable<(FrameRequest, usize)>: Sync, RawTable<(FrameRequest, Vec<u8>)>: Sync, RawTable<(usize, Vec<u8>)>: Sync,

§

impl Unpin for StreamingBundle
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for StreamingBundle

§

impl UnwindSafe for StreamingBundle

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.