We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bac128 commit fb8351cCopy full SHA for fb8351c
vm/src/pyobject.rs
@@ -1557,6 +1557,7 @@ impl PyObject {
1557
Rc::new(self)
1558
}
1559
1560
+ #[inline]
1561
pub fn payload<T: PyValue>(&self) -> Option<&T> {
1562
self.payload.as_any().downcast_ref()
1563
@@ -1571,6 +1572,7 @@ pub trait PyObjectPayload: Any + fmt::Debug + 'static {
1571
1572
1573
1574
impl<T: PyValue + 'static> PyObjectPayload for T {
1575
1576
fn as_any(&self) -> &dyn Any {
1577
self
1578
0 commit comments