Trait pyo3::class::descr::PyDescrProtocol [−][src]
pub trait PyDescrProtocol<'p>: PyClass { fn __get__(
slf: Self::Receiver,
instance: Self::Inst,
owner: Option<Self::Owner>
) -> Self::Result
where
Self: PyDescrGetProtocol<'p>, { ... } fn __set__(
slf: Self::Receiver,
instance: Self::Inst,
value: Self::Value
) -> Self::Result
where
Self: PyDescrSetProtocol<'p>, { ... } fn __delete__(&'p self, instance: &'p PyAny) -> Self::Result
where
Self: PyDescrDeleteProtocol<'p>, { ... } fn __set_name__(&'p self, instance: &'p PyAny) -> Self::Result
where
Self: PyDescrSetNameProtocol<'p>, { ... } }
Expand description
Descriptor interface
Provided methods
fn __get__(
slf: Self::Receiver,
instance: Self::Inst,
owner: Option<Self::Owner>
) -> Self::Result where
Self: PyDescrGetProtocol<'p>,
fn __set__(
slf: Self::Receiver,
instance: Self::Inst,
value: Self::Value
) -> Self::Result where
Self: PyDescrSetProtocol<'p>,
fn __delete__(&'p self, instance: &'p PyAny) -> Self::Result where
Self: PyDescrDeleteProtocol<'p>,
fn __delete__(&'p self, instance: &'p PyAny) -> Self::Result where
Self: PyDescrDeleteProtocol<'p>,
👎 Deprecated since 0.14.0:
prefer implementing __delete__
in #[pymethods]
instead of in a protocol
fn __set_name__(&'p self, instance: &'p PyAny) -> Self::Result where
Self: PyDescrSetNameProtocol<'p>,
fn __set_name__(&'p self, instance: &'p PyAny) -> Self::Result where
Self: PyDescrSetNameProtocol<'p>,
👎 Deprecated since 0.14.0:
prefer implementing __set_name__
in #[pymethods]
instead of in a protocol