pub enum DataType {
Text(String),
Bytes(Vec<u8>),
}
Expand description
§DataType
This returns the data type of the response, wrapping the response as well
Used mostly for returning static images as bytes
for example, if you’re requesting for a static image from say /static/img.png
,
you would want Bytes(content)
instead of Text(content)
. The API already handles
this for you, but it is worth keeping in mind how it works behind the scenes
Variants§
Text(String)
Defines a Text data type - this is for returning text, such as HTML
Bytes(Vec<u8>)
Defines a Bytes data type - this is for returning binary data, such as images
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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