Struct deltachat::html::HtmlMsgParser
source · struct HtmlMsgParser {
pub html: String,
pub plain: Option<PlainText>,
}
Expand description
HtmlMsgParser converts a mime-message to HTML.
Fields§
§html: String
§plain: Option<PlainText>
Implementations§
source§impl HtmlMsgParser
impl HtmlMsgParser
sourcepub async fn from_bytes(context: &Context, rawmime: &[u8]) -> Result<Self>
pub async fn from_bytes(context: &Context, rawmime: &[u8]) -> Result<Self>
Function takes a raw mime-message string, searches for the main-text part and returns that as parser.html
sourceasync fn collect_texts_recursive<'a>(
&'a mut self,
mail: &'a ParsedMail<'a>
) -> Result<()>
async fn collect_texts_recursive<'a>( &'a mut self, mail: &'a ParsedMail<'a> ) -> Result<()>
Function iterates over all mime-parts and searches for text/plain and text/html parts and saves the first one found. in the corresponding structure fields.
Usually, there is at most one plain-text and one HTML-text part, multiple plain-text parts might be used for mailinglist-footers, therefore we use the first one.
sourceasync fn cid_to_data_recursive<'a>(
&'a mut self,
context: &'a Context,
mail: &'a ParsedMail<'a>
) -> Result<()>
async fn cid_to_data_recursive<'a>( &'a mut self, context: &'a Context, mail: &'a ParsedMail<'a> ) -> Result<()>
Replace cid:-protocol by the data:-protocol where appropriate. This allows the final html-file to be self-contained.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for HtmlMsgParser
impl Send for HtmlMsgParser
impl Sync for HtmlMsgParser
impl Unpin for HtmlMsgParser
impl UnwindSafe for HtmlMsgParser
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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