#[non_exhaustive]pub enum Document {
WebPage(ArchivedPage),
}Expand description
Types of documents that can be stored in the flora archive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
WebPage(ArchivedPage)
A web page (typically HTML).
Implementations§
Source§impl Document
impl Document
Sourcepub fn new_web_page_unchecked(data: Vec<u8>) -> Self
pub fn new_web_page_unchecked(data: Vec<u8>) -> Self
Creates a Document variant for a web page (HTML).
Does not check that the given data is actually HTML.
Sourcepub fn into_web_page(self) -> Option<Vec<u8>>
pub fn into_web_page(self) -> Option<Vec<u8>>
Returns the HTML data if the document is an HTML or text web page.
If it’s not a web page, returns None.
Trait Implementations§
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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