pub trait HumusApiFormat: Clone + Send {
// Required methods
fn get_name(&self) -> HumusFormatIdentifier;
fn get_media_type(&self) -> Mime;
fn from_name(name: &HumusFormatIdentifier) -> Option<Self>;
fn get_all() -> Vec<Self>;
}Expand description
Trait for types that describe the API format, that is managed by the application.
It is best implemented on an Enum type;
Required Methods§
Sourcefn get_name(&self) -> HumusFormatIdentifier
fn get_name(&self) -> HumusFormatIdentifier
Returns the name of the format
Sourcefn get_media_type(&self) -> Mime
fn get_media_type(&self) -> Mime
Returns the Mimetype that is expected for this output format.
Sourcefn from_name(name: &HumusFormatIdentifier) -> Option<Self>
fn from_name(name: &HumusFormatIdentifier) -> Option<Self>
Constructs a view from its name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".