pub enum SlotFunc {
Show 34 variants
Init(fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult<()>),
Hash(fn(&PyObject, &VirtualMachine) -> PyResult<PyHash>),
Str(fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>),
Repr(fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>),
Iter(fn(PyObjectRef, &VirtualMachine) -> PyResult),
IterNext(fn(&PyObject, &VirtualMachine) -> PyResult<PyIterReturn>),
Call(fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult),
Del(fn(&PyObject, &VirtualMachine) -> PyResult<()>),
GetAttro(fn(&PyObject, &Py<PyStr>, &VirtualMachine) -> PyResult),
SetAttro(fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>),
DelAttro(fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>),
RichCompare(fn(&PyObject, &PyObject, PyComparisonOp, &VirtualMachine) -> PyResult<Either<PyObjectRef, PyComparisonValue>>, PyComparisonOp),
DescrGet(fn(&PyObject, Option<&PyObject>, Option<&PyObject>, &VirtualMachine) -> PyResult),
DescrSet(fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>),
DescrDel(fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>),
SeqLength(fn(PySequence<'_>, &VirtualMachine) -> PyResult<usize>),
SeqConcat(fn(PySequence<'_>, &PyObject, &VirtualMachine) -> PyResult),
SeqRepeat(fn(PySequence<'_>, isize, &VirtualMachine) -> PyResult),
SeqItem(fn(PySequence<'_>, isize, &VirtualMachine) -> PyResult),
SeqSetItem(fn(PySequence<'_>, isize, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>),
SeqDelItem(fn(PySequence<'_>, isize, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>),
SeqContains(fn(PySequence<'_>, &PyObject, &VirtualMachine) -> PyResult<bool>),
MapLength(fn(PyMapping<'_>, &VirtualMachine) -> PyResult<usize>),
MapSubscript(fn(PyMapping<'_>, &PyObject, &VirtualMachine) -> PyResult),
MapSetSubscript(fn(PyMapping<'_>, &PyObject, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>),
MapDelSubscript(fn(PyMapping<'_>, &PyObject, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>),
NumBoolean(PyNumberUnaryFunc<bool>),
NumUnary(PyNumberUnaryFunc),
NumBinary(PyNumberBinaryFunc),
NumBinaryRight(PyNumberBinaryFunc),
NumTernary(PyNumberTernaryFunc),
NumTernaryRight(PyNumberTernaryFunc),
GetBuffer(fn(&PyObject, BufferFlags, &VirtualMachine) -> PyResult<PyBuffer>),
ReleaseBuffer,
}Expand description
Each variant knows how to call the wrapped function with proper types
Variants§
Init(fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult<()>)
Hash(fn(&PyObject, &VirtualMachine) -> PyResult<PyHash>)
Str(fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>)
Repr(fn(&PyObject, &VirtualMachine) -> PyResult<PyRef<PyStr>>)
Iter(fn(PyObjectRef, &VirtualMachine) -> PyResult)
IterNext(fn(&PyObject, &VirtualMachine) -> PyResult<PyIterReturn>)
Call(fn(&PyObject, FuncArgs, &VirtualMachine) -> PyResult)
Del(fn(&PyObject, &VirtualMachine) -> PyResult<()>)
GetAttro(fn(&PyObject, &Py<PyStr>, &VirtualMachine) -> PyResult)
SetAttro(fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>)
DelAttro(fn(&PyObject, &Py<PyStr>, PySetterValue, &VirtualMachine) -> PyResult<()>)
RichCompare(fn(&PyObject, &PyObject, PyComparisonOp, &VirtualMachine) -> PyResult<Either<PyObjectRef, PyComparisonValue>>, PyComparisonOp)
DescrGet(fn(&PyObject, Option<&PyObject>, Option<&PyObject>, &VirtualMachine) -> PyResult)
DescrSet(fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>)
DescrDel(fn(&PyObject, PyObjectRef, PySetterValue, &VirtualMachine) -> PyResult<()>)
SeqLength(fn(PySequence<'_>, &VirtualMachine) -> PyResult<usize>)
SeqConcat(fn(PySequence<'_>, &PyObject, &VirtualMachine) -> PyResult)
SeqRepeat(fn(PySequence<'_>, isize, &VirtualMachine) -> PyResult)
SeqItem(fn(PySequence<'_>, isize, &VirtualMachine) -> PyResult)
SeqSetItem(fn(PySequence<'_>, isize, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>)
SeqDelItem(fn(PySequence<'_>, isize, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>)
SeqContains(fn(PySequence<'_>, &PyObject, &VirtualMachine) -> PyResult<bool>)
MapLength(fn(PyMapping<'_>, &VirtualMachine) -> PyResult<usize>)
MapSubscript(fn(PyMapping<'_>, &PyObject, &VirtualMachine) -> PyResult)
MapSetSubscript(fn(PyMapping<'_>, &PyObject, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>)
MapDelSubscript(fn(PyMapping<'_>, &PyObject, Option<PyObjectRef>, &VirtualMachine) -> PyResult<()>)
NumBoolean(PyNumberUnaryFunc<bool>)
NumUnary(PyNumberUnaryFunc)
NumBinary(PyNumberBinaryFunc)
NumBinaryRight(PyNumberBinaryFunc)
NumTernary(PyNumberTernaryFunc)
NumTernaryRight(PyNumberTernaryFunc)
GetBuffer(fn(&PyObject, BufferFlags, &VirtualMachine) -> PyResult<PyBuffer>)
ReleaseBuffer
Implementations§
Source§impl SlotFunc
impl SlotFunc
Sourcepub fn call(
&self,
obj: PyObjectRef,
args: FuncArgs,
vm: &VirtualMachine,
) -> PyResult
pub fn call( &self, obj: PyObjectRef, args: FuncArgs, vm: &VirtualMachine, ) -> PyResult
Call the wrapped slot function with proper type handling
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlotFunc
impl RefUnwindSafe for SlotFunc
impl Send for SlotFunc
impl Sync for SlotFunc
impl Unpin for SlotFunc
impl UnsafeUnpin for SlotFunc
impl UnwindSafe for SlotFunc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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