Struct pyo3::PyByteArray[][src]

pub struct PyByteArray(_);

Represents a Python bytearray.

Methods

impl PyByteArray
[src]

Creates a new Python bytearray object. The byte string is initialized by copying the data from the &[u8].

Panics if out of memory.

Creates a new Python bytearray object from other PyObject, that implements the buffer protocol.

Gets the length of the bytearray.

Check if bytearray is empty.

Gets the Python bytearray data as byte slice.

Resize bytearray object.

Trait Implementations

impl<'a> From<&'a PyByteArray> for &'a PyObjectRef
[src]

Performs the conversion.

impl AsRef<PyObjectRef> for PyByteArray
[src]

Performs the conversion.

impl PyObjectWithToken for PyByteArray
[src]

impl ToPyPointer for PyByteArray
[src]

Gets the underlying FFI pointer, returns a borrowed pointer.

impl PartialEq for PyByteArray
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PyTypeInfo for PyByteArray
[src]

Type of objects to store in PyObject struct

Base class

NAME: &'static str = "PyByteArray"

Class name

SIZE: usize = ::std::mem::size_of::<::ffi::PyObject>()

Size of the rust PyObject structure (PyObject + rust structure)

OFFSET: isize = 0

Type instance offset inside PyObject structure

PyTypeObject instance for this type

Check if *mut ffi::PyObject is instance of this type

DESCRIPTION: &'static str = "\u{0}"

Class doc string

FLAGS: usize = 0

Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)

Check if *mut ffi::PyObject is exact instance of this type

impl PyTypeObject for PyByteArray
[src]

Initialize type object

Retrieves the type object for this Python object type.

Create PyRawObject which can be initialized with rust value

impl ToPyObject for PyByteArray
[src]

Converts self into a Python object.

impl ToBorrowedObject for PyByteArray
[src]

Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object. Read more

impl Debug for PyByteArray
[src]

Formats the value using the given formatter. Read more

impl Display for PyByteArray
[src]

Formats the value using the given formatter. Read more

impl<'a> FromPyObject<'a> for &'a PyByteArray
[src]

Extracts Self from the source PyObject.

Auto Trait Implementations

impl Send for PyByteArray

impl Sync for PyByteArray