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.Auto Trait Implementations§
impl !Send for BytesContent
impl !Sync for BytesContent
impl Freeze 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