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)

Tuple Fields

0: String

Defines a Text data type - this is for returning text, such as HTML

Bytes(Vec<u8>)

Tuple Fields

0: Vec<u8>

Defines a Bytes data type - this is for returning binary data, such as images

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.