pub struct PyMapping<'a> {
pub obj: &'a PyObject,
pub methods: &'static PyMappingMethods,
}
Fields§
§obj: &'a PyObject
§methods: &'static PyMappingMethods
Implementations§
Source§impl<'a> PyMapping<'a>
impl<'a> PyMapping<'a>
pub fn try_protocol(obj: &'a PyObject, vm: &VirtualMachine) -> PyResult<Self>
Source§impl PyMapping<'_>
impl PyMapping<'_>
pub fn check(obj: &PyObject) -> bool
pub fn find_methods(obj: &PyObject) -> Option<PointerSlot<PyMappingMethods>>
pub fn length_opt(self, vm: &VirtualMachine) -> Option<PyResult<usize>>
pub fn length(self, vm: &VirtualMachine) -> PyResult<usize>
pub fn subscript(self, needle: &impl AsObject, vm: &VirtualMachine) -> PyResult
pub fn ass_subscript( self, needle: &impl AsObject, value: Option<PyObjectRef>, vm: &VirtualMachine, ) -> PyResult<()>
pub fn keys(self, vm: &VirtualMachine) -> PyResult
pub fn values(self, vm: &VirtualMachine) -> PyResult
pub fn items(self, vm: &VirtualMachine) -> PyResult
Trait Implementations§
Source§impl Traverse for PyMapping<'_>
impl Traverse for PyMapping<'_>
Source§fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
impl
traverse()
with caution! Following those guideline so traverse doesn’t cause memory error!: Read moreimpl<'a> Copy for PyMapping<'a>
Auto Trait Implementations§
impl<'a> Freeze for PyMapping<'a>
impl<'a> !RefUnwindSafe for PyMapping<'a>
impl<'a> !Send for PyMapping<'a>
impl<'a> !Sync for PyMapping<'a>
impl<'a> Unpin for PyMapping<'a>
impl<'a> !UnwindSafe for PyMapping<'a>
Blanket Implementations§
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,
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