[−][src]Function enqueuemail::page_title_from_html
pub fn page_title_from_html(
content: &[u8]
) -> Result<Option<String>, Box<dyn Error>>
Extract the page title tag content from a raw but well formed HTML content.
The implementation of this functions is a Nom parser.
Type Definition nom::IResult.
Holds the result of parsing functions
type IResult<I, O, E = (I, ErrorKind)> = Result<(I, O), Err
The Ok side is a pair containing the remainder of the input (the part of the data that was not parsed) and the produced value. The Err side contains an instance of nom::Err. let (, (, , title)) = match tuple::<, , VerboseError<>, _>(...
Function nom::bytes::complete::take_until
Returns the longest input slice till it matches the pattern.
It doesn't consume the pattern. It will return Err(Err::Error((_rest, ErrorKind::TakeUntil))) if the pattern wasn't met.
Function std::str::from_utf8 Converts a vector of bytes to a String.
A string (String) is made of bytes (u8), and a vector of bytes (Vec
Also uses from_utft8.