pub trait Content {
// Required methods
fn metadata(&self) -> ContentMetadata;
fn open(&self) -> ContentFuture<'_, Result<ContentReaderRef, ContentError>>;
// Provided method
fn read_all(&self) -> ContentFuture<'_, Result<Vec<u8>, ContentError>> { ... }
}Expand description
One readable piece of content from any source.
Required Methods§
Sourcefn metadata(&self) -> ContentMetadata
fn metadata(&self) -> ContentMetadata
What the provider states about this content without reading it.
Sourcefn open(&self) -> ContentFuture<'_, Result<ContentReaderRef, ContentError>>
fn open(&self) -> ContentFuture<'_, Result<ContentReaderRef, ContentError>>
Opens a chunked reader over the bytes.
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".