Skip to main content

ContentHandles

Trait ContentHandles 

Source
pub trait ContentHandles<H>: Content + Item<H> { }
Expand description

A declaration whose uploads hold handles of type H: any declaration without uploads, for every H, and one whose uploads are Upload<H>. It is implemented for every such declaration, so that generic code can name what ContentParser parses.

use base_web_content::{ContentError, ContentHandles, ContentParser};
use base_web_media_type::MediaType;

fn parser_for<T: ContentHandles<std::path::PathBuf>>(media_type: &MediaType) -> Result<ContentParser<T, std::path::PathBuf>, ContentError> {
    ContentParser::new(Some(media_type))
}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Content + Item<H>, H> ContentHandles<H> for T