Trait pyo3::class::mapping::PyMappingProtocol [−][src]
pub trait PyMappingProtocol<'p>: PyClass {
fn __len__(&'p self) -> Self::Result
where
Self: PyMappingLenProtocol<'p>,
{ ... }
fn __getitem__(&'p self, key: Self::Key) -> Self::Result
where
Self: PyMappingGetItemProtocol<'p>,
{ ... }
fn __setitem__(
&'p mut self,
key: Self::Key,
value: Self::Value
) -> Self::Result
where
Self: PyMappingSetItemProtocol<'p>,
{ ... }
fn __delitem__(&'p mut self, key: Self::Key) -> Self::Result
where
Self: PyMappingDelItemProtocol<'p>,
{ ... }
fn __reversed__(&'p self) -> Self::Result
where
Self: PyMappingReversedProtocol<'p>,
{ ... }
}
Expand description
Mapping interface
Provided methods
fn __len__(&'p self) -> Self::Result where
Self: PyMappingLenProtocol<'p>,
fn __getitem__(&'p self, key: Self::Key) -> Self::Result where
Self: PyMappingGetItemProtocol<'p>,
fn __setitem__(&'p mut self, key: Self::Key, value: Self::Value) -> Self::Result where
Self: PyMappingSetItemProtocol<'p>,
fn __delitem__(&'p mut self, key: Self::Key) -> Self::Result where
Self: PyMappingDelItemProtocol<'p>,
fn __reversed__(&'p self) -> Self::Result where
Self: PyMappingReversedProtocol<'p>,
fn __reversed__(&'p self) -> Self::Result where
Self: PyMappingReversedProtocol<'p>,
👎 Deprecated since 0.14.0:
prefer implementing __reversed__
in #[pymethods]
instead of in a protocol