mirror of
https://github.com/stalwartlabs/mail-parser.git
synced 2026-11-28 16:01:16 +00:00
Added raw_message() function
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
mail-parser 0.8.1
|
||||
================================
|
||||
- Added `raw_message()` function.
|
||||
|
||||
mail-parser 0.8.0
|
||||
================================
|
||||
- Removed get_() prefixes (#31).
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "mail-parser"
|
||||
description = "Fast and robust e-mail parsing library for Rust"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2018"
|
||||
authors = [ "Stalwart Labs <hello@stalw.art>"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
||||
@@ -983,6 +983,14 @@ impl<'x> Message<'x> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns the raw message
|
||||
pub fn raw_message(&self) -> &[u8] {
|
||||
let part = &self.parts[0];
|
||||
self.raw_message
|
||||
.get(part.offset_header..part.offset_end)
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Returns the BCC header field
|
||||
pub fn bcc(&self) -> &HeaderValue {
|
||||
self.parts[0]
|
||||
|
||||
Reference in New Issue
Block a user