Enum sea_streamer_file::DynFileSource
source · pub enum DynFileSource {
FileReader(FileReader),
FileSource(FileSource),
Dead,
}
Expand description
A runtime adapter of FileReader
and FileSource
,
also able to switch between the two mode of operations dynamically.
Variants§
FileReader(FileReader)
FileSource(FileSource)
Dead
If you encounter this, it’s a programming mistake
Implementations§
source§impl DynFileSource
impl DynFileSource
pub async fn new( file_id: FileId, stype: FileSourceType ) -> Result<Self, FileErr>
pub async fn seek(&mut self, to: SeqPos) -> Result<u64, FileErr>
pub fn source_type(&self) -> FileSourceType
sourcepub async fn switch_to(self, stype: FileSourceType) -> Result<Self, FileErr>
pub async fn switch_to(self, stype: FileSourceType) -> Result<Self, FileErr>
Switch to a different mode of operation.
Warning: This future must not be canceled.
pub async fn end(self) -> AsyncFile
pub fn offset(&self) -> u64
pub fn file_size(&self) -> u64
pub fn is_dead(&self) -> bool
Trait Implementations§
source§impl ByteSource for DynFileSource
impl ByteSource for DynFileSource
type Future<'a> = DynReadFuture<'a>
fn request_bytes(&mut self, size: usize) -> Self::Future<'_>
Auto Trait Implementations§
impl Freeze for DynFileSource
impl RefUnwindSafe for DynFileSource
impl Send for DynFileSource
impl Sync for DynFileSource
impl Unpin for DynFileSource
impl UnwindSafe for DynFileSource
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