Skip to main content

PyBufferRequestType

Trait PyBufferRequestType 

Source
pub trait PyBufferRequestType: Sealed {
    type WithFormat: PyBufferRequestType + IncludesFormat;
    type WithShape: PyBufferRequestType + IncludesShape;
    type WithStrides: PyBufferRequestType + IncludesShape + IncludesStrides;
    type WithIndirect: PyBufferRequestType + IncludesShape + IncludesStrides + IncludesSuboffsets;
    type WithWritable: PyBufferRequestType;
    type WithCContiguous: PyBufferRequestType;
    type WithFContiguous: PyBufferRequestType;
    type WithAnyContiguous: PyBufferRequestType;

    const IS_SIMPLE: bool;
    const CONTIGUITY: PyBufferContiguity;
    const WRITABLE: bool;
}
Available on Py_3_11 or non-Py_LIMITED_API only.
Expand description

Trait implemented by all hidden super::PyBufferRequest states.

Required Associated Constants§

Source

const IS_SIMPLE: bool

Whether this is a simple request, which treats the buffer as unsigned bytes.

Source

const CONTIGUITY: PyBufferContiguity

The contiguity requirement encoded by these flags.

Source

const WRITABLE: bool

Whether these flags require a writable buffer.

Required Associated Types§

Source

type WithFormat: PyBufferRequestType + IncludesFormat

The state after requesting format information.

Source

type WithShape: PyBufferRequestType + IncludesShape

The state after requesting shape information.

Source

type WithStrides: PyBufferRequestType + IncludesShape + IncludesStrides

The state after requesting strides information.

Source

type WithIndirect: PyBufferRequestType + IncludesShape + IncludesStrides + IncludesSuboffsets

The state after requesting indirect / suboffset information.

Source

type WithWritable: PyBufferRequestType

The state after requesting writability.

Source

type WithCContiguous: PyBufferRequestType

The state after requesting C contiguity.

Source

type WithFContiguous: PyBufferRequestType

The state after requesting Fortran contiguity.

Source

type WithAnyContiguous: PyBufferRequestType

The state after requesting either C or Fortran contiguity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const FORMAT: bool, const SHAPE: bool, const STRIDE: bool, const INDIRECT: bool, const WRITABLE: bool, const CONTIGUITY_REQ: u8> PyBufferRequestType for PyBufferFlags<FORMAT, SHAPE, STRIDE, INDIRECT, WRITABLE, CONTIGUITY_REQ>

Source§

const IS_SIMPLE: bool

Source§

const CONTIGUITY: PyBufferContiguity

Source§

const WRITABLE: bool = WRITABLE

Source§

type WithFormat = PyBufferFlags<true, SHAPE, STRIDE, INDIRECT, WRITABLE, CONTIGUITY_REQ>

Source§

type WithShape = PyBufferFlags<FORMAT, true, STRIDE, INDIRECT, WRITABLE, CONTIGUITY_REQ>

Source§

type WithStrides = PyBufferFlags<FORMAT, true, true, INDIRECT, WRITABLE, CONTIGUITY_REQ>

Source§

type WithIndirect = PyBufferFlags<FORMAT, true, true, true, WRITABLE, CONTIGUITY_UNDEFINED>

Source§

type WithWritable = PyBufferFlags<FORMAT, SHAPE, STRIDE, INDIRECT, true, CONTIGUITY_REQ>

Source§

type WithCContiguous = PyBufferFlags<FORMAT, true, true, false, WRITABLE, CONTIGUITY_C>

Source§

type WithFContiguous = PyBufferFlags<FORMAT, true, true, false, WRITABLE, CONTIGUITY_F>

Source§

type WithAnyContiguous = PyBufferFlags<FORMAT, true, true, false, WRITABLE, CONTIGUITY_ANY>

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here