Trait pyo3::prelude::PyFrozenSetMethods
source · pub trait PyFrozenSetMethods<'py>: Sealed {
// Required methods
fn len(&self) -> usize;
fn contains<K>(&self, key: K) -> PyResult<bool>
where K: ToPyObject;
fn iter(&self) -> BoundFrozenSetIterator<'py> ⓘ;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
Implementation of functionality for PyFrozenSet
.
These methods are defined for the Bound<'py, PyFrozenSet>
smart pointer, so to use method call
syntax these methods are separated into a trait, because stable Rust does not yet support
arbitrary_self_types
.
Required Methods§
sourcefn len(&self) -> usize
fn len(&self) -> usize
Returns the number of items in the set.
This is equivalent to the Python expression len(self)
.
sourcefn contains<K>(&self, key: K) -> PyResult<bool>where
K: ToPyObject,
fn contains<K>(&self, key: K) -> PyResult<bool>where
K: ToPyObject,
Determines if the set contains the specified key.
This is equivalent to the Python expression key in self
.
sourcefn iter(&self) -> BoundFrozenSetIterator<'py> ⓘ
fn iter(&self) -> BoundFrozenSetIterator<'py> ⓘ
Returns an iterator of values in this set.
Provided Methods§
Object Safety§
This trait is not object safe.