GeezerVison is showing rustpython.github.io — rustpython_vm::pyobject::Either - Rust pub enum Either<A, B> {
A(A),
B(B),
}
Variants
MethodsTrait ImplementationsThis allows a builtin method to accept arguments that may be one of two
types, raising a TypeError if it is neither.
use rustpython_vm::VirtualMachine;
use rustpython_vm::obj::{objstr::PyStringRef, objint::PyIntRef};
use rustpython_vm::pyobject::Either;
fn do_something(arg: Either<PyIntRef, PyStringRef>, vm: &VirtualMachine) {
match arg {
Either::A(int)=> {
// do something with int
}
Either::B(string) => {
// do something with string
}
}
}
Attempt to convert a Python object to a value of this type.
Auto Trait ImplementationsBlanket Implementationsimpl<T> Any for T where T: 'static + ?Sized, [src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The range of positional arguments permitted by the function signature. Read more
Extracts this item from the next argument(s).
impl<T, U> Into<U> for T where U: From<T>, [src]
impl<T> Same<T> for T
impl<T, U> TryFrom<U> for T where U: Into<T>, [src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
impl<V, T> VZip<V> for T where V: MultiLane<T>,
|