update buffer proto tests
This commit is contained in:
parent
201289d6ca
commit
1f2c927bd5
|
@ -86,7 +86,6 @@ extern crate libc;
|
|||
#[macro_use]
|
||||
pub extern crate pyo3cls;
|
||||
|
||||
pub use pyo3cls as cls;
|
||||
pub use pyo3cls::*;
|
||||
|
||||
pub mod ffi;
|
||||
|
|
|
@ -7,14 +7,15 @@ use std::ptr;
|
|||
use std::os::raw::{c_int, c_void};
|
||||
|
||||
use pyo3::*;
|
||||
use pyo3::cls;
|
||||
|
||||
|
||||
py_class!(class TestClass |py| {
|
||||
data vec: Vec<u8>;
|
||||
});
|
||||
#[py::class]
|
||||
struct TestClass {
|
||||
vec: Vec<u8>,
|
||||
}
|
||||
|
||||
#[cls::py_impl]
|
||||
|
||||
#[py::proto]
|
||||
impl class::PyBufferProtocol for TestClass {
|
||||
fn bf_getbuffer(&self, py: Python, view: *mut ffi::Py_buffer, flags: c_int) -> PyResult<()> {
|
||||
|
||||
|
|
Loading…
Reference in New Issue