1
- use crate :: buffer:: { BufferOptions , PyBuffer , PyBufferInternal } ;
2
1
use crate :: builtins:: slice:: PySliceRef ;
3
2
use crate :: builtins:: { PyBytes , PyBytesRef , PyList , PyListRef , PyStr , PyStrRef , PyTypeRef } ;
4
3
use crate :: bytesinner:: bytes_to_hex;
@@ -9,6 +8,7 @@ use crate::common::{
9
8
rc:: PyRc ,
10
9
} ;
11
10
use crate :: function:: { FuncArgs , OptionalArg } ;
11
+ use crate :: protocol:: { BufferInternal , BufferOptions , PyBuffer } ;
12
12
use crate :: sliceable:: { convert_slice, wrap_index, SequenceIndex } ;
13
13
use crate :: slots:: { AsBuffer , Comparable , Hashable , PyComparisonOp , SlotConstructor } ;
14
14
use crate :: stdlib:: pystruct:: _struct:: FormatSpec ;
@@ -692,7 +692,7 @@ impl AsBuffer for PyMemoryView {
692
692
693
693
#[ derive( Debug ) ]
694
694
struct Released ;
695
- impl PyBufferInternal for Released {
695
+ impl BufferInternal for Released {
696
696
fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
697
697
panic ! ( ) ;
698
698
}
@@ -706,7 +706,7 @@ impl PyBufferInternal for Released {
706
706
fn retain ( & self ) { }
707
707
}
708
708
709
- impl PyBufferInternal for PyMemoryView {
709
+ impl BufferInternal for PyMemoryView {
710
710
// NOTE: This impl maybe is anti-pattern. Only used for internal usage.
711
711
fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
712
712
BorrowedValue :: map ( self . buffer . internal . obj_bytes ( ) , |x| {
@@ -725,7 +725,7 @@ impl PyBufferInternal for PyMemoryView {
725
725
fn retain ( & self ) { }
726
726
}
727
727
728
- impl PyBufferInternal for PyRef < PyMemoryView > {
728
+ impl BufferInternal for PyRef < PyMemoryView > {
729
729
fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
730
730
self . deref ( ) . obj_bytes ( )
731
731
}
0 commit comments