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

rust: add from_slice

parent 8d131449
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,12 @@ impl DhtCertificate {
}
}
pub fn from_slice(buffer: &str) -> Box<DhtCertificate> {
unsafe {
Box::from_raw(dht_certificate_import((&*buffer).as_ptr(), buffer.len()))
}
}
pub fn id(&self) -> InfoHash {
unsafe {
dht_certificate_get_id(&*self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment