#[repr(C)]pub struct PyGetSetDef {
pub name: *const i8,
pub get: Option<unsafe extern "C" fn(_: *mut PyObject, _: *mut c_void) -> *mut PyObject>,
pub set: Option<unsafe extern "C" fn(_: *mut PyObject, _: *mut PyObject, _: *mut c_void) -> i32>,
pub doc: *const i8,
pub closure: *mut c_void,
}
Expand description
Represents the PyGetSetDef structure.
Note that CPython may leave fields uninitialized. You must ensure that
name
!= NULL before dereferencing or reading other fields.
Fields§
§name: *const i8
§get: Option<unsafe extern "C" fn(_: *mut PyObject, _: *mut c_void) -> *mut PyObject>
§set: Option<unsafe extern "C" fn(_: *mut PyObject, _: *mut PyObject, _: *mut c_void) -> i32>
§doc: *const i8
§closure: *mut c_void
Trait Implementations§
Source§impl Clone for PyGetSetDef
impl Clone for PyGetSetDef
Source§fn clone(&self) -> PyGetSetDef
fn clone(&self) -> PyGetSetDef
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PyGetSetDef
impl Debug for PyGetSetDef
Source§impl Default for PyGetSetDef
impl Default for PyGetSetDef
Source§fn default() -> PyGetSetDef
fn default() -> PyGetSetDef
Returns the “default value” for a type. Read more
Source§impl Eq for PyGetSetDef
impl Eq for PyGetSetDef
#[doc(hidden)] fn assert_receiver_is_total_eq(&self)
Source§impl PartialEq for PyGetSetDef
impl PartialEq for PyGetSetDef
impl Copy for PyGetSetDef
impl StructuralPartialEq for PyGetSetDef
Auto Trait Implementations§
impl Freeze for PyGetSetDef
impl RefUnwindSafe for PyGetSetDef
impl !Send for PyGetSetDef
impl !Sync for PyGetSetDef
impl Unpin for PyGetSetDef
impl UnwindSafe for PyGetSetDef
Blanket Implementations§
Source§impl<T> AssertNotZeroSized for T
impl<T> AssertNotZeroSized for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more