pub trait TryFromObject:Sized { fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>;}
Implemented by any type that can be created from a Python object.
Any type that implementsTryFromObject
is automaticallyFromArgs
, andso can be accepted as a argument to a built-in function.
fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
Attempt to convert a Python object to a value of this type.
implTryFromObject forbool
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<bool>
[src]implTryFromObject forf32
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject forf64
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject forisize
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject fori8
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject fori16
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject fori32
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject fori64
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject forusize
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject foru8
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject foru16
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject foru32
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject foru64
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl<T: TryFromObject>TryFromObject forOption<T>
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]implTryFromObject forDuration
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forExceptionCtor
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forPyBytesLike
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forRangeIndex
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forSequenceIndex
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forIntoPyBool
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forPyByteInner
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forIntoPyFloat
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forPyCallable
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl TryFromObject forPyObjectRef
[src]fntry_from_object(_vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl<A, B> TryFromObject forEither<A, B>where
A:TryFromObject,
B:TryFromObject,
[src]This allows a builtin method to accept arguments that may be one of twotypes, raising aTypeError
if it is neither.
userustpython_vm::VirtualMachine;userustpython_vm::obj::{objstr::PyStringRef,objint::PyIntRef};userustpython_vm::pyobject::Either;fndo_something(arg:Either<PyIntRef,PyStringRef>,vm:&VirtualMachine) {matcharg {Either::A(int)=> {// do something with int }Either::B(string)=> {// do something with string } }}
fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl<T> TryFromObject forPyIterable<T>where
T:TryFromObject,
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]impl<T> TryFromObject forPyRef<T>where
T:PyValue,
[src]fntry_from_object(vm: &VirtualMachine, obj:PyObjectRef) ->PyResult<Self>
[src]