Skip to main content

Module buffer

Module buffer 

Source
Available on Py_3_11 or non-Py_LIMITED_API only.
Expand description

PyBuffer implementation

Re-exportsยง

use crate::inspect::PyStaticExpr; ๐Ÿ”’ experimental-inspect
use crate::inspect::type_hint_identifier; ๐Ÿ”’ experimental-inspect
use crate::Borrowed; ๐Ÿ”’
use crate::Bound; ๐Ÿ”’
use crate::PyErr; ๐Ÿ”’
use crate::FromPyObject; ๐Ÿ”’
use crate::FromPyObject; ๐Ÿ”’
use crate::PyAny; ๐Ÿ”’
use crate::PyResult; ๐Ÿ”’
use crate::Python; ๐Ÿ”’
use crate::err; ๐Ÿ”’
use crate::exceptions::PyBufferError; ๐Ÿ”’
use crate::ffi; ๐Ÿ”’
use core::ffi::c_char; ๐Ÿ”’
use core::ffi::c_int; ๐Ÿ”’
use core::ffi::c_long; ๐Ÿ”’
use core::ffi::c_longlong; ๐Ÿ”’
use core::ffi::c_schar; ๐Ÿ”’
use core::ffi::c_short; ๐Ÿ”’
use core::ffi::c_uchar; ๐Ÿ”’
use core::ffi::c_uint; ๐Ÿ”’
use core::ffi::c_ulong; ๐Ÿ”’
use core::ffi::c_ulonglong; ๐Ÿ”’
use core::ffi::c_ushort; ๐Ÿ”’
use core::ffi::c_void; ๐Ÿ”’
use core::marker::PhantomData; ๐Ÿ”’
use core::marker::PhantomPinned; ๐Ÿ”’
use core::pin::Pin; ๐Ÿ”’
use core::ptr::NonNull; ๐Ÿ”’
use core::cell; ๐Ÿ”’
use core::mem; ๐Ÿ”’
use core::ptr; ๐Ÿ”’
use core::slice; ๐Ÿ”’
use core::ffi::CStr; ๐Ÿ”’
use core::fmt::Debug; ๐Ÿ”’
use core::fmt::Debug; ๐Ÿ”’
use self::flags::CONTIGUITY_C; ๐Ÿ”’
use self::flags::CONTIGUITY_UNDEFINED; ๐Ÿ”’
use self::flags::PyBufferFlags as RequestFlags; ๐Ÿ”’
use self::flags::PyBufferRequestType; ๐Ÿ”’
use crate::platform::prelude::*; ๐Ÿ”’

Modulesยง

flags ๐Ÿ”’

Macrosยง

impl_element ๐Ÿ”’

Structsยง

BufferViewGuard ๐Ÿ”’
Drops an initialized view in place, including when the callback panics. The viewโ€™s storage is a MaybeUninit, so it will not be dropped a second time.
PyBuffer
A typed form of PyUntypedBuffer.
PyBufferRequest
Type-safe buffer request. The state parameter is intentionally hidden behind this wrapper so the internal encoding can evolve.
PyBufferView
A typed form of PyUntypedBufferView. Not constructible directly โ€” use PyBufferView::with() or PyBufferView::with_flags().
PyUntypedBuffer
Allows access to the underlying buffer used by a python object such as bytes, bytearray or array.array.
PyUntypedBufferView
Stack-allocated untyped buffer view.
RawBuffer ๐Ÿ”’
Wrapper around ffi::Py_buffer to be !Unpin.
ReadOnlyCell
Like core::cell::Cell, but only provides read-only access to the data.

Enumsยง

ElementType
Represents the type of a Python buffer element.
PyBufferContiguity
Contiguity constraint encoded by a PyBufferRequest.

Traitsยง

Element
Trait implemented for possible element types of PyBuffer.

Functionsยง

check_buffer_compatibility ๐Ÿ”’
Check that a buffer is compatible with element type T.
debug_buffer ๐Ÿ”’
is_matching_endian ๐Ÿ”’ Little-endian
native_element_type_from_type_char ๐Ÿ”’
standard_element_type_from_type_char ๐Ÿ”’
โš ๏ธ Internal Docs โš ๏ธ Not Public API ๐Ÿ‘‰ Official Docs Here