pub struct PyObject<T: ?Sized>where
T:PyObjectPayload, { pub typ:PyClassRef, pub dict:Option<RefCell<PyDictRef>>, pub payload: T,}
This is an actual python object. It consists of atyp
which is thepython class, and carries some rust payload optionally. This rustpayload can be a rust float or rust int in case of float and int objects.
typ:PyClassRef
dict:Option<RefCell<PyDictRef>>
payload: T
implPyObject<dynPyObjectPayload>
[src]pub fndowncast<T: PyObjectPayload>(
self:Rc<Self>
) ->Result<PyRef<T>,PyObjectRef>
[src]Attempt to downcast this reference to a subclass.
If the downcast fails, the original ref is returned in asErr
soanother downcast can be attempted without unnecessary cloning.
impl<T>PyObject<T>where
T:Sized +PyObjectPayload,
[src]pub fnnew(payload: T, typ:PyClassRef, dict:Option<PyDictRef>) ->PyObjectRef
[src]pub fninto_ref(self) ->PyObjectRef
[src]implPyObject<dynPyObjectPayload>
[src]pub fnpayload<T: PyObjectPayload>(&self) ->Option<&T>
[src]pub fnpayload_is<T: PyObjectPayload>(&self) ->bool
[src]pub fnpayload_if_subclass<T: PyObjectPayload +PyValue>(
&self,
vm: &VirtualMachine
) ->Option<&T>
[src]implDebug forPyObject<dynPyObjectPayload>
[src]implDisplay forPyObject<dynPyObjectPayload>
[src]impl<T: ?Sized +PyObjectPayload>IdProtocol forPyObject<T>
[src]impl<T: ?Sized>TypeProtocol forPyObject<T>where
T:PyObjectPayload,
[src]fnclass(&self) ->PyClassRef
[src]impl<T> !RefUnwindSafe forPyObject<T>
impl<T> !Send forPyObject<T>
impl<T> !Sync forPyObject<T>
impl<T: ?Sized>Unpin forPyObject<T>where
T:Unpin,
impl<T> !UnwindSafe forPyObject<T>
impl<T>Any for Twhere
T: 'static + ?Sized,
[src]impl<T>Borrow<T> for Twhere
T: ?Sized,
[src]impl<T>BorrowMut<T> for Twhere
T: ?Sized,
[src]fnborrow_mut(&mut self) ->&mutT
[src]impl<T>From<T> for T
[src]impl<T, U>Into<U> for Twhere
U:From<T>,
[src]impl<T> Same<T> for T
typeOutput = T
Should always beSelf
impl<T>ToString for Twhere
T:Display + ?Sized,
[src]impl<T, U>TryFrom<U> for Twhere
U:Into<T>,
[src]typeError =Infallible
The type returned in the event of a conversion error.
fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>
[src]impl<T, U>TryInto<U> for Twhere
U:TryFrom<T>,
[src]typeError = <U asTryFrom<T>>::Error
The type returned in the event of a conversion error.
fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>
[src]impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fnvzip(self) -> V