-
-
Save rrichardson/d2b106f2d91be4ea3070e2d11a22577e to your computer and use it in GitHub Desktop.
lifetimes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn create<'a, I>(&self, key: &K, values: I, ttl: Option<i64>) -> Result<(), Error> | |
where I: Iterator<Item=&'a T> | |
{ | |
let kbuf = serialize(&key, Infinite)?; | |
let mut vbuf : Vec<u8> = Vec::with_capacity(32); | |
set_ttl(&mut vbuf, ttl)?; | |
{ | |
let val : VecDeque<&T> = values.collect(); | |
serialize_into(&mut vbuf, &val, Infinite).map_err(Error::from)?; | |
} | |
self.db.put_cf(self.cf, kbuf.as_slice(), vbuf.as_slice()).map_err( | |
Error::from, | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment