pub struct FileBackend { /* private fields */ }Expand description
Seekable file-backed media source.
This backend can copy byte ranges with MediaReadAt::read_at, but it does
not expose borrowed windows. A future sliding-window backend can build on
the same typed range/error contract while adding cache-backed window_at.
Implementations§
Source§impl FileBackend
impl FileBackend
Trait Implementations§
Source§impl Debug for FileBackend
impl Debug for FileBackend
Source§impl MediaReadAt for FileBackend
impl MediaReadAt for FileBackend
Source§fn read_at(
&self,
range: ByteRange,
dst: &mut [u8],
) -> Result<usize, ReadAtError>
fn read_at( &self, range: ByteRange, dst: &mut [u8], ) -> Result<usize, ReadAtError>
Copy exactly
range.len bytes into dst.Source§fn window_at(&self, _range: ByteRange) -> Result<&[u8], ReadAtError>
fn window_at(&self, _range: ByteRange) -> Result<&[u8], ReadAtError>
Borrow exactly
range.len bytes from the source.fn is_empty(&self) -> bool
Source§fn window_at_partial(&self, range: ByteRange) -> Result<&[u8], ReadAtError>
fn window_at_partial(&self, range: ByteRange) -> Result<&[u8], ReadAtError>
Borrow up to
range.len bytes. The offset must still be in bounds.Source§fn as_contiguous(&self) -> Option<&[u8]>
fn as_contiguous(&self) -> Option<&[u8]>
Return the complete contiguous source only for compatibility paths.
fn stats(&self) -> SourceStats
Auto Trait Implementations§
impl !Freeze for FileBackend
impl RefUnwindSafe for FileBackend
impl Send for FileBackend
impl Sync for FileBackend
impl Unpin for FileBackend
impl UnsafeUnpin for FileBackend
impl UnwindSafe for FileBackend
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