New imap-proto
This commit is contained in:
parent
c28d08851c
commit
d132de4834
3 changed files with 8 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ path = "src/lib.rs"
|
|||
native-tls = "0.1"
|
||||
regex = "0.2"
|
||||
bufstream = "0.1"
|
||||
imap-proto = "0.4"
|
||||
imap-proto = "0.4.1"
|
||||
nom = "3.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ pub fn parse_fetches(lines: Vec<u8>) -> ZeroCopyResult<Vec<Fetch>> {
|
|||
message: num,
|
||||
flags: vec![],
|
||||
uid: None,
|
||||
rfc822_header: None,
|
||||
rfc822: None,
|
||||
};
|
||||
|
||||
|
|
@ -93,6 +94,7 @@ pub fn parse_fetches(lines: Vec<u8>) -> ZeroCopyResult<Vec<Fetch>> {
|
|||
}
|
||||
AttributeValue::Uid(uid) => fetch.uid = Some(uid),
|
||||
AttributeValue::Rfc822(rfc) => fetch.rfc822 = rfc,
|
||||
AttributeValue::Rfc822Header(rfc) => fetch.rfc822_header = rfc,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ pub struct Fetch {
|
|||
pub message: u32,
|
||||
pub(crate) flags: Vec<&'static str>,
|
||||
pub uid: Option<u32>,
|
||||
pub(crate) rfc822_header: Option<&'static [u8]>,
|
||||
pub(crate) rfc822: Option<&'static [u8]>,
|
||||
}
|
||||
|
||||
|
|
@ -13,6 +14,10 @@ impl Fetch {
|
|||
&self.flags[..]
|
||||
}
|
||||
|
||||
pub fn rfc822_header<'a>(&'a self) -> Option<&'a [u8]> {
|
||||
self.rfc822_header
|
||||
}
|
||||
|
||||
pub fn rfc822<'a>(&'a self) -> Option<&'a [u8]> {
|
||||
self.rfc822
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue