pub trait PyMappingProtocol<'p>: PyClass<Frozen = False> {
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>,
{ ... }
}
👎 Deprecated since 0.16.0:
prefer #[pymethods]
to #[pyproto]
Available on crate feature
pyproto
only.Expand description
Mapping interface
Provided Methods
fn __len__(&'p self) -> Self::Result where
Self: PyMappingLenProtocol<'p>,
fn __len__(&'p self) -> Self::Result where
Self: PyMappingLenProtocol<'p>,
👎 Deprecated since 0.16.0:
prefer #[pymethods]
to #[pyproto]
fn __getitem__(&'p self, key: Self::Key) -> Self::Result where
Self: PyMappingGetItemProtocol<'p>,
fn __getitem__(&'p self, key: Self::Key) -> Self::Result where
Self: PyMappingGetItemProtocol<'p>,
👎 Deprecated since 0.16.0:
prefer #[pymethods]
to #[pyproto]
fn __setitem__(&'p mut self, key: Self::Key, value: Self::Value) -> Self::Result where
Self: PyMappingSetItemProtocol<'p>,
fn __setitem__(&'p mut self, key: Self::Key, value: Self::Value) -> Self::Result where
Self: PyMappingSetItemProtocol<'p>,
👎 Deprecated since 0.16.0:
prefer #[pymethods]
to #[pyproto]
fn __delitem__(&'p mut self, key: Self::Key) -> Self::Result where
Self: PyMappingDelItemProtocol<'p>,
fn __delitem__(&'p mut self, key: Self::Key) -> Self::Result where
Self: PyMappingDelItemProtocol<'p>,
👎 Deprecated since 0.16.0:
prefer #[pymethods]
to #[pyproto]