pub struct DataContent {
pub uri: String,
pub media_type: Option<String>,
}Expand description
Inline binary data encoded as a data: URI.
Fields§
§uri: String§media_type: Option<String>Implementations§
Source§impl DataContent
impl DataContent
Sourcepub fn from_bytes(data: &[u8], media_type: impl Into<String>) -> DataContent
pub fn from_bytes(data: &[u8], media_type: impl Into<String>) -> DataContent
Build a data URI from raw bytes and a media type.
Trait Implementations§
Source§impl Clone for DataContent
impl Clone for DataContent
Source§fn clone(&self) -> DataContent
fn clone(&self) -> DataContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DataContent
impl Debug for DataContent
Source§impl<'de> Deserialize<'de> for DataContent
impl<'de> Deserialize<'de> for DataContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DataContent
impl PartialEq for DataContent
Source§impl Serialize for DataContent
impl Serialize for DataContent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for DataContent
Auto Trait Implementations§
impl Freeze for DataContent
impl RefUnwindSafe for DataContent
impl Send for DataContent
impl Sync for DataContent
impl Unpin for DataContent
impl UnsafeUnpin for DataContent
impl UnwindSafe for DataContent
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