1- use crate :: buffer:: { BufferOptions , PyBuffer , PyBufferInternal } ;
21use crate :: builtins:: slice:: PySliceRef ;
32use crate :: builtins:: { PyBytes , PyBytesRef , PyList , PyListRef , PyStr , PyStrRef , PyTypeRef } ;
43use crate :: bytesinner:: bytes_to_hex;
@@ -9,6 +8,7 @@ use crate::common::{
98 rc:: PyRc ,
109} ;
1110use crate :: function:: { FuncArgs , OptionalArg } ;
11+ use crate :: protocol:: { BufferInternal , BufferOptions , PyBuffer } ;
1212use crate :: sliceable:: { convert_slice, wrap_index, SequenceIndex } ;
1313use crate :: slots:: { AsBuffer , Comparable , Hashable , PyComparisonOp , SlotConstructor } ;
1414use crate :: stdlib:: pystruct:: _struct:: FormatSpec ;
@@ -692,7 +692,7 @@ impl AsBuffer for PyMemoryView {
692692
693693#[ derive( Debug ) ]
694694struct Released ;
695- impl PyBufferInternal for Released {
695+ impl BufferInternal for Released {
696696 fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
697697 panic ! ( ) ;
698698 }
@@ -706,7 +706,7 @@ impl PyBufferInternal for Released {
706706 fn retain ( & self ) { }
707707}
708708
709- impl PyBufferInternal for PyMemoryView {
709+ impl BufferInternal for PyMemoryView {
710710 // NOTE: This impl maybe is anti-pattern. Only used for internal usage.
711711 fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
712712 BorrowedValue :: map ( self . buffer . internal . obj_bytes ( ) , |x| {
@@ -725,7 +725,7 @@ impl PyBufferInternal for PyMemoryView {
725725 fn retain ( & self ) { }
726726}
727727
728- impl PyBufferInternal for PyRef < PyMemoryView > {
728+ impl BufferInternal for PyRef < PyMemoryView > {
729729 fn obj_bytes ( & self ) -> BorrowedValue < [ u8 ] > {
730730 self . deref ( ) . obj_bytes ( )
731731 }
0 commit comments