[−][src]Trait pyo3::AsPyRef
Trait implements object reference extraction from python managed pointer.
Required methods
fn as_ref(&self, py: Python) -> &T
Return reference to object.
fn as_mut(&mut self, py: Python) -> &mut T
Return mutable reference to object.
Provided methods
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &T) -> R,
F: FnOnce(Python, &T) -> R,
Acquire python gil and call closure with object reference.
fn with_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(Python, &mut T) -> R,
F: FnOnce(Python, &mut T) -> R,
Acquire python gil and call closure with mutable object reference.
fn into_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,
Implementors
impl AsPyRef<PyObjectRef> for PyObject[src]
fn as_ref(&self, _py: Python) -> &PyObjectRef[src]
fn as_mut(&mut self, _py: Python) -> &mut PyObjectRef[src]
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &T) -> R, [src]
F: FnOnce(Python, &T) -> R,
fn with_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(Python, &mut T) -> R, [src]
F: FnOnce(Python, &mut T) -> R,
fn into_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R, [src]
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R, [src]
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,
impl<T> AsPyRef<T> for Py<T> where
T: PyTypeInfo, [src]
T: PyTypeInfo,
fn as_ref(&self, py: Python) -> &T[src]
fn as_mut(&mut self, py: Python) -> &mut T[src]
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, &T) -> R, [src]
F: FnOnce(Python, &T) -> R,
fn with_mut<F, R>(&mut self, f: F) -> R where
F: FnOnce(Python, &mut T) -> R, [src]
F: FnOnce(Python, &mut T) -> R,
fn into_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R, [src]
Self: IntoPyPointer,
F: FnOnce(Python, &T) -> R,
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R, [src]
Self: IntoPyPointer,
F: FnOnce(Python, &mut T) -> R,