pub struct DataUrl<'a> { /* private fields */ }
Implementations
sourceimpl<'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>>where
F: FnMut(&[u8]) -> Result<(), E>,
pub fn decode<F, E>(
&self,
write_body_bytes: F
) -> Result<Option<FragmentIdentifier<'a>>, DecodeError<E>>where
F: FnMut(&[u8]) -> Result<(), 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> 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more