pub struct FileContent { /* private fields */ }Expand description
A file on the local filesystem.
Implementations§
Trait Implementations§
Source§impl Content for FileContent
impl Content for FileContent
Source§fn metadata(&self) -> ContentMetadata
fn metadata(&self) -> ContentMetadata
What the provider states about this content without reading it.
Source§fn media_uri(&self) -> Result<String, ContentError>
fn media_uri(&self) -> Result<String, ContentError>
Returns a playback reference without reading or copying the audio.
Providers retain any platform grant required to reopen this reference.
Browser references remain valid until the page is closed.
Source§fn media_uri_async(&self) -> ContentFuture<'_, Result<String, ContentError>>
fn media_uri_async(&self) -> ContentFuture<'_, Result<String, ContentError>>
Retains a playback reference without blocking the UI on platform I/O.
Providers with filesystem access grants override this method and perform
that work on the blocking executor. No audio is read or copied.
Source§fn open(&self) -> ContentFuture<'_, Result<ContentReaderRef, ContentError>>
fn open(&self) -> ContentFuture<'_, Result<ContentReaderRef, ContentError>>
Opens a chunked reader over the bytes.
Source§fn read_all(&self) -> ContentFuture<'_, Result<Vec<u8>, ContentError>>
fn read_all(&self) -> ContentFuture<'_, Result<Vec<u8>, ContentError>>
Reads every byte. The default drains
open; providers
already holding the bytes override it to avoid the copy.Auto Trait Implementations§
impl Forget for FileContent
impl Freeze for FileContent
impl Move for FileContent
impl RefUnwindSafe for FileContent
impl Send for FileContent
impl Sync for FileContent
impl Unpin for FileContent
impl UnsafeUnpin for FileContent
impl UnwindSafe for FileContent
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