pub struct DataUrl<'a> { /* private fields */ }Implementations§
Source§impl<'a> DataUrl<'a>
impl<'a> DataUrl<'a>
Sourcepub fn process(input: &'a str) -> Result<Self, DataUrlError>
pub fn process(input: &'a str) -> Result<Self, DataUrlError>
https://fetch.spec.whatwg.org/#data-url-processor
but starting from a string rather than a parsed Url, to avoid extra string copies.
pub fn mime_type(&self) -> &Mime
Sourcepub fn decode<F, E>(
&self,
write_body_bytes: F,
) -> Result<Option<FragmentIdentifier<'a>>, DecodeError<E>>
pub fn decode<F, E>( &self, write_body_bytes: F, ) -> Result<Option<FragmentIdentifier<'a>>, DecodeError<E>>
Streaming-decode the data URL’s body to write_body_bytes,
and return the URL’s fragment identifier if it has one.
Sourcepub fn decode_to_vec(
&self,
) -> Result<(Vec<u8>, Option<FragmentIdentifier<'a>>), InvalidBase64>
pub fn decode_to_vec( &self, ) -> Result<(Vec<u8>, Option<FragmentIdentifier<'a>>), InvalidBase64>
Return the decoded body, and the URL’s fragment identifier if it has one.
Auto Trait Implementations§
impl<'a> Freeze for DataUrl<'a>
impl<'a> RefUnwindSafe for DataUrl<'a>
impl<'a> Send for DataUrl<'a>
impl<'a> Sync for DataUrl<'a>
impl<'a> Unpin for DataUrl<'a>
impl<'a> UnwindSafe for DataUrl<'a>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes