pub fn resize(&self, len: usize) -> PyResult<()> {
        unsafe {
            let result = ffi::PyByteArray_Resize(self.as_ptr(), len as ffi::Py_ssize_t);
            if result == 0 {
                Ok(())
            } else {
                Err(PyErr::api_call_failed(self.py()))
            }
        }
    }
/// Resizes the bytearray object to the new length `len`.
///
/// Note that this will invalidate any pointers obtained by [PyByteArray::data], as well as
/// any (unsafe) slices obtained from [PyByteArray::as_bytes] and [PyByteArray::as_bytes_mut].
Resizes the bytearray object to the new length `len`.
Resizes the bytearray object to the new length ` len ` .
pub fn resize(&self, len: usize) -> PyResult<()> {
        unsafe {
            let result = ffi::PyByteArray_Resize(self.as_ptr(), len as ffi::Py_ssize_t);
            if result == 0 {
                Ok(())
            } else {
                Err(PyErr::api_call_failed(self.py()))
            }
        }
    }
pub fn resize ( & self , len : usize ) -> PyResult < ( ) > { unsafe { let result = ffi :: PyByteArray_Resize ( self . as_ptr ( ) , len as ffi :: Py_ssize_t ) ; if result == 0 { Ok ( ( ) ) } else { Err ( PyErr :: api_call_failed ( self . py ( ) ) ) } } }
Resizes the bytearray object to the new length `len`.
Resizes the bytearray object to the new length ` len ` .
&self
len
usize