pub struct BytesContent { /* private fields */ }Expand description
Content already held in memory: clipboard drops, web File payloads, tests.
Implementations§
Source§impl BytesContent
impl BytesContent
Trait Implementations§
Source§impl Content for BytesContent
impl Content for BytesContent
Source§fn metadata(&self) -> ContentMetadata
fn metadata(&self) -> ContentMetadata
What the provider states about this content without reading it.
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.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.
Auto Trait Implementations§
impl !Send for BytesContent
impl !Sync for BytesContent
impl Forget for BytesContent
impl Freeze for BytesContent
impl Move for BytesContent
impl RefUnwindSafe for BytesContent
impl Unpin for BytesContent
impl UnsafeUnpin for BytesContent
impl UnwindSafe for BytesContent
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