pub struct PySequence<'a> {
pub obj: &'a PyObject,
}Fields§
§obj: &'a PyObjectImplementations§
Source§impl PySequence<'_>
impl PySequence<'_>
pub fn slots(&self) -> &PySequenceSlots
pub fn check(&self) -> bool
pub fn length_opt(self, vm: &VirtualMachine) -> Option<PyResult<usize>>
pub fn length(self, vm: &VirtualMachine) -> PyResult<usize>
pub fn concat(self, other: &PyObject, vm: &VirtualMachine) -> PyResult
pub fn repeat(self, n: isize, vm: &VirtualMachine) -> PyResult
pub fn inplace_concat(self, other: &PyObject, vm: &VirtualMachine) -> PyResult
pub fn inplace_repeat(self, n: isize, vm: &VirtualMachine) -> PyResult
pub fn get_item(self, i: isize, vm: &VirtualMachine) -> PyResult
pub fn set_item( self, i: isize, value: PyObjectRef, vm: &VirtualMachine, ) -> PyResult<()>
pub fn del_item(self, i: isize, vm: &VirtualMachine) -> PyResult<()>
pub fn get_slice( &self, start: isize, stop: isize, vm: &VirtualMachine, ) -> PyResult
pub fn set_slice( &self, start: isize, stop: isize, value: PyObjectRef, vm: &VirtualMachine, ) -> PyResult<()>
pub fn del_slice( &self, start: isize, stop: isize, vm: &VirtualMachine, ) -> PyResult<()>
pub fn tuple(&self, vm: &VirtualMachine) -> PyResult<PyTupleRef>
pub fn list(&self, vm: &VirtualMachine) -> PyResult<PyListRef>
pub fn count(&self, target: &PyObject, vm: &VirtualMachine) -> PyResult<usize>
pub fn index(&self, target: &PyObject, vm: &VirtualMachine) -> PyResult<usize>
pub fn extract<F, R>(&self, f: F, vm: &VirtualMachine) -> PyResult<Vec<R>>
pub fn contains(self, target: &PyObject, vm: &VirtualMachine) -> PyResult<bool>
Trait Implementations§
Source§impl<'a> Clone for PySequence<'a>
impl<'a> Clone for PySequence<'a>
Source§fn clone(&self) -> PySequence<'a>
fn clone(&self) -> PySequence<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Traverse for PySequence<'_>
impl Traverse for PySequence<'_>
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 moreSource§fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
Extract all owned child PyObjectRefs for circular reference resolution (tp_clear).
Called just before object deallocation to break circular references.
Default implementation does nothing.
impl<'a> Copy for PySequence<'a>
Auto Trait Implementations§
impl<'a> Freeze for PySequence<'a>
impl<'a> !RefUnwindSafe for PySequence<'a>
impl<'a> !Send for PySequence<'a>
impl<'a> !Sync for PySequence<'a>
impl<'a> Unpin for PySequence<'a>
impl<'a> UnsafeUnpin for PySequence<'a>
impl<'a> !UnwindSafe for PySequence<'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