pub enum HtmlTextJsonFormat {
Html,
Text,
Json,
}
Available on crate feature
axum-view
only.Expand description
Ready to use example implementation of a HumusFormat
featuring html
, text
and json
.
When using this it is recommended to crete a type alias in case this isn’t sufficient in the future.
type MyResponseFormat = lib_humus::HtmlTextJsonFormat;
Variants§
Html
An html response.
Text
A plain text response to be viewed in a terminal.
Json
A json response for other programs.
Trait Implementations§
Source§impl Clone for HtmlTextJsonFormat
impl Clone for HtmlTextJsonFormat
Source§fn clone(&self) -> HtmlTextJsonFormat
fn clone(&self) -> HtmlTextJsonFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HtmlTextJsonFormat
impl Debug for HtmlTextJsonFormat
Source§impl Default for HtmlTextJsonFormat
impl Default for HtmlTextJsonFormat
Source§fn default() -> HtmlTextJsonFormat
fn default() -> HtmlTextJsonFormat
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HtmlTextJsonFormat
impl<'de> Deserialize<'de> for HtmlTextJsonFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HumusFormat for HtmlTextJsonFormat
impl HumusFormat for HtmlTextJsonFormat
Source§fn get_family(&self) -> HumusFormatFamily
fn get_family(&self) -> HumusFormatFamily
Return wheter this format should be processed in Template or API mode.
Source§fn get_file_extension(&self) -> String
fn get_file_extension(&self) -> String
Returns the file extnsion for the format. Read more
Source§fn get_mime_type(&self) -> Mime
fn get_mime_type(&self) -> Mime
Returns the Mimetype that is expected for this output format. Read more
Source§impl Serialize for HtmlTextJsonFormat
impl Serialize for HtmlTextJsonFormat
Auto Trait Implementations§
impl Freeze for HtmlTextJsonFormat
impl RefUnwindSafe for HtmlTextJsonFormat
impl Send for HtmlTextJsonFormat
impl Sync for HtmlTextJsonFormat
impl Unpin for HtmlTextJsonFormat
impl UnwindSafe for HtmlTextJsonFormat
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