-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from neon-bindings/ArrayBuffer
ArrayBuffer
- Loading branch information
Showing
11 changed files
with
97 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ Cargo.lock | |
**/.DS_Store | ||
**/build | ||
**/index.node | ||
**/artifacts.json | ||
npm-debug.log |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Facilities for working with `v8::ArrayBuffer`s. | ||
use raw::Local; | ||
use cslice::CMutSlice; | ||
use std::os::raw::c_void; | ||
|
||
// Suppress a spurious rustc warning about the use of CMutSlice. | ||
#[allow(improper_ctypes)] | ||
extern "C" { | ||
|
||
/// Mutates the `out` argument provided to refer to a newly created `v8::ArrayBuffer` object. | ||
/// Returns `false` if the value couldn't be created. | ||
#[link_name = "Neon_ArrayBuffer_New"] | ||
pub fn new(out: &mut Local, isolate: *mut c_void, size: u32) -> bool; | ||
|
||
/// Mutates the `out` argument provided populating the `data` and `len` properties. | ||
#[link_name = "Neon_ArrayBuffer_Data"] | ||
pub fn data<'a, 'b>(out: &'a mut CMutSlice<'b, u8>, obj: Local); | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pub use internal::js::binary::JsBuffer; | ||
pub use internal::js::binary::{JsBuffer, JsArrayBuffer}; |
This file contains 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