Merge pull request #1 from greenpdx/body
Added passing email with fetch
This commit is contained in:
commit
adb35b5a54
2 changed files with 7 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ pub fn parse_fetches(lines: Vec<u8>) -> ZeroCopyResult<Vec<Fetch>> {
|
||||||
uid: None,
|
uid: None,
|
||||||
rfc822_header: None,
|
rfc822_header: None,
|
||||||
rfc822: None,
|
rfc822: None,
|
||||||
|
email: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
for attr in attrs {
|
for attr in attrs {
|
||||||
|
|
@ -95,6 +96,7 @@ pub fn parse_fetches(lines: Vec<u8>) -> ZeroCopyResult<Vec<Fetch>> {
|
||||||
AttributeValue::Uid(uid) => fetch.uid = Some(uid),
|
AttributeValue::Uid(uid) => fetch.uid = Some(uid),
|
||||||
AttributeValue::Rfc822(rfc) => fetch.rfc822 = rfc,
|
AttributeValue::Rfc822(rfc) => fetch.rfc822 = rfc,
|
||||||
AttributeValue::Rfc822Header(rfc) => fetch.rfc822_header = rfc,
|
AttributeValue::Rfc822Header(rfc) => fetch.rfc822_header = rfc,
|
||||||
|
AttributeValue::BodySection {section: _, index: _, data} => fetch.email = data,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ pub struct Fetch {
|
||||||
pub uid: Option<u32>,
|
pub uid: Option<u32>,
|
||||||
pub(crate) rfc822_header: Option<&'static [u8]>,
|
pub(crate) rfc822_header: Option<&'static [u8]>,
|
||||||
pub(crate) rfc822: Option<&'static [u8]>,
|
pub(crate) rfc822: Option<&'static [u8]>,
|
||||||
|
pub(crate) email: Option<&'static [u8]>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Fetch {
|
impl Fetch {
|
||||||
|
|
@ -21,4 +22,8 @@ impl Fetch {
|
||||||
pub fn rfc822<'a>(&'a self) -> Option<&'a [u8]> {
|
pub fn rfc822<'a>(&'a self) -> Option<&'a [u8]> {
|
||||||
self.rfc822
|
self.rfc822
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn email<'a>(&'a self) -> Option<&'a [u8]> {
|
||||||
|
self.email
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue