Skip to content
Snippets Groups Projects
Commit 48b763f1 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

rust: add from_bytes for value

parent cbfa12a9
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,12 @@ impl Value {
data.as_bytes().len()))
}
}
pub fn from_bytes(data: &Vec<u8>) -> Box<Value> {
unsafe {
Box::from_raw(dht_value_new(data.as_ptr(),
data.len()))
}
}
pub fn id(&self) -> u64 {
unsafe {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment