pub unsafe trait Element: Copy {
fn is_compatible_format(format: &CStr) -> bool;
}
Available on non-
Py_LIMITED_API
or Py_3_11
only.Expand description
Trait implemented for possible element types of PyBuffer
.
Safety
This trait must only be implemented for types which represent valid elements of Python buffers.
Required Methods
fn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Gets whether the element specified in the format string is potentially compatible. Alignment and size are checked separately from this function.
Implementations on Foreign Types
sourceimpl Element for u8
impl Element for u8
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for u16
impl Element for u16
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for u32
impl Element for u32
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for u64
impl Element for u64
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for usize
impl Element for usize
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for i8
impl Element for i8
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for i16
impl Element for i16
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for i32
impl Element for i32
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for i64
impl Element for i64
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for isize
impl Element for isize
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for f32
impl Element for f32
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.sourceimpl Element for f64
impl Element for f64
sourcefn is_compatible_format(format: &CStr) -> bool
fn is_compatible_format(format: &CStr) -> bool
Available on non-
Py_LIMITED_API
or Py_3_11
only.