buffer example
This commit is contained in:
parent
aa77c8ff97
commit
8b4e7af67f
7 changed files with 20 additions and 0 deletions
crates/napi/src/bindgen_runtime/js_values
|
@ -18,6 +18,12 @@ impl From<Vec<u8>> for Buffer {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&[u8]> for Buffer {
|
||||
fn from(inner: &[u8]) -> Self {
|
||||
Buffer::from(inner.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for Buffer {
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
self.inner.as_slice()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue