pub struct ProgressiveFile { /* private fields */ }Expand description
State of a progressively loaded file
Implementations§
Source§impl ProgressiveFile
impl ProgressiveFile
Sourcepub fn new(
ekey: EKey,
size_hint: SizeHint,
config: ProgressiveConfig,
loader: Weak<dyn ChunkLoader + Send + Sync>,
) -> Self
pub fn new( ekey: EKey, size_hint: SizeHint, config: ProgressiveConfig, loader: Weak<dyn ChunkLoader + Send + Sync>, ) -> Self
Create a new progressive file loader
Sourcepub async fn read(&self, offset: u64, length: usize) -> Result<Vec<u8>>
pub async fn read(&self, offset: u64, length: usize) -> Result<Vec<u8>>
Read data from the progressive file
Sourcepub async fn get_stats(&self) -> LoadingStats
pub async fn get_stats(&self) -> LoadingStats
Get current loading statistics
Sourcepub fn get_size_hint(&self) -> SizeHint
pub fn get_size_hint(&self) -> SizeHint
Get the current size estimate
Sourcepub async fn is_fully_loaded(&self) -> bool
pub async fn is_fully_loaded(&self) -> bool
Check if the file is fully loaded
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProgressiveFile
impl !RefUnwindSafe for ProgressiveFile
impl Send for ProgressiveFile
impl Sync for ProgressiveFile
impl Unpin for ProgressiveFile
impl !UnwindSafe for ProgressiveFile
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
Mutably borrows from an owned value. Read more