pub trait Content {
// Required methods
fn metadata(&self) -> ContentMetadata;
fn open(
&self,
) -> Pin<Box<dyn Future<Output = Result<Rc<dyn ContentReader>, ContentError>> + '_>>;
// Provided method
fn read_all(
&self,
) -> Pin<Box<dyn Future<Output = 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,
) -> Pin<Box<dyn Future<Output = Result<Rc<dyn ContentReader>, ContentError>> + '_>>
fn open( &self, ) -> Pin<Box<dyn Future<Output = Result<Rc<dyn ContentReader>, ContentError>> + '_>>
Opens a chunked reader over the bytes.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".