pub struct MarkdownToPartsBuilder { /* private fields */ }
Implementations§
Source§impl MarkdownToPartsBuilder
impl MarkdownToPartsBuilder
Sourcepub fn regex(self, regex: Regex) -> Self
pub fn regex(self, regex: Regex) -> Self
§Panics
regex
must have a Regex with only 1 capture group with file URL as first capture
group, else it PANICS when .build()
is called.
Sourcepub fn guess_mime_type(self, guess_mime_type: fn(url: &str) -> Mime) -> Self
pub fn guess_mime_type(self, guess_mime_type: fn(url: &str) -> Mime) -> Self
guess_mime_type
is used to detect mimi_type of URL pointing to file system or web resource
with no “Content-Type” header.
Sourcepub fn decide_download(
self,
decide_download: fn(headers: &HeaderMap) -> bool,
) -> Self
pub fn decide_download( self, decide_download: fn(headers: &HeaderMap) -> bool, ) -> Self
decide_download
is used to decide if to download. If it returns false, resource will not
be fetched and won’t be in parts
pub fn timeout(self, timeout: Duration) -> Self
pub async fn build<'a>(self, markdown: &'a str) -> MarkdownToParts<'a>
Auto Trait Implementations§
impl Freeze for MarkdownToPartsBuilder
impl RefUnwindSafe for MarkdownToPartsBuilder
impl Send for MarkdownToPartsBuilder
impl Sync for MarkdownToPartsBuilder
impl Unpin for MarkdownToPartsBuilder
impl UnwindSafe for MarkdownToPartsBuilder
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