[−][src]Trait cpython::ToPyObject
Conversion trait that allows various objects to be converted into Python objects.
Note: The associated type ObjectType
is used so that some Rust types
convert to a more precise type of Python object.
For example, [T]::to_py_object()
will result in a PyList
.
You can always calls val.to_py_object(py).into_py_object()
in order to obtain PyObject
(the second into_py_object() call via the PythonObject trait corresponds to the upcast from PyList
to PyObject
).
Associated Types
type ObjectType: PythonObject
[src]
Required methods
pub fn to_py_object(&self, py: Python<'_>) -> Self::ObjectType
[src]
Converts self into a Python object.
Provided methods
pub fn into_py_object(self, py: Python<'_>) -> Self::ObjectType where
Self: Sized,
[src]
Self: Sized,
Converts self into a Python object.
May be more efficient than to_py_object
in some cases because
it can move out of the input object.
pub fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object.
May be more efficient than to_py_object
because it does not need
to touch any reference counts when the input object already is a Python object.
Implementations on Foreign Types
impl<'a, T: ?Sized> ToPyObject for &'a T where
T: ToPyObject,
[src]
T: ToPyObject,
ToPyObject
for references: calls to_py_object() on the underlying T
.
type ObjectType = T::ObjectType
pub fn to_py_object(&self, py: Python<'_>) -> T::ObjectType
[src]
pub fn into_py_object(self, py: Python<'_>) -> T::ObjectType
[src]
pub fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl<T> ToPyObject for Option<T> where
T: ToPyObject,
[src]
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
type ObjectType = PyObject
pub fn to_py_object(&self, py: Python<'_>) -> PyObject
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyObject
[src]
impl ToPyObject for bool
[src]
Converts a rust bool
to a Python bool
.
type ObjectType = PyBool
pub fn to_py_object(&self, py: Python<'_>) -> PyBool
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl<K, V, H> ToPyObject for HashMap<K, V, H> where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
[src]
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
Converts a Rust HashMap
to a Python dict
.
type ObjectType = PyDict
pub fn to_py_object(&self, py: Python<'_>) -> PyDict
[src]
impl<K, V> ToPyObject for BTreeMap<K, V> where
K: Eq + ToPyObject,
V: ToPyObject,
[src]
K: Eq + ToPyObject,
V: ToPyObject,
Converts a Rust BTreeMap
to a Python dict
.
type ObjectType = PyDict
pub fn to_py_object(&self, py: Python<'_>) -> PyDict
[src]
impl<T> ToPyObject for [T] where
T: ToPyObject,
[src]
T: ToPyObject,
Converts a Rust slice to a Python list
.
Note: this conversion can be inefficient since a Python object is created
for each element of the list. For primitive types T
, consider using
the buffer protocol instead.
type ObjectType = PyList
pub fn to_py_object(&self, py: Python<'_>) -> PyList
[src]
impl<T> ToPyObject for Vec<T> where
T: ToPyObject,
[src]
T: ToPyObject,
Converts a Rust slice to a Python list
.
Note: this conversion can be inefficient since a Python object is created
for each element of the list. For primitive types T
, consider using
the buffer protocol instead.
type ObjectType = PyList
pub fn to_py_object(&self, py: Python<'_>) -> PyList
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyList
[src]
impl ToPyObject for i8
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for u8
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for i16
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for u16
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for i32
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for u32
[src]
Conversion of Rust integer to Python int
.
On Python 2.x, may also result in a long
if the value does not fit into a Python int
.
type ObjectType = <u64 as ToPyObject>::ObjectType
pub fn to_py_object(&self, py: Python<'_>) -> <u64 as ToPyObject>::ObjectType
[src]
impl<'p> ToPyObject for i64
[src]
Conversion of Rust integer to Python int
.
On Python 2.x, may also result in a long
if the value does not fit into a Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for isize
[src]
Conversion of Rust integer to Python int
.
On Python 2.x, may also result in a long
if the value does not fit into a Python int
.
type ObjectType = <i64 as ToPyObject>::ObjectType
pub fn to_py_object(&self, py: Python<'_>) -> <i64 as ToPyObject>::ObjectType
[src]
impl ToPyObject for usize
[src]
Conversion of Rust integer to Python int
.
On Python 2.x, may also result in a long
if the value does not fit into a Python int
.
type ObjectType = <u64 as ToPyObject>::ObjectType
pub fn to_py_object(&self, py: Python<'_>) -> <u64 as ToPyObject>::ObjectType
[src]
impl<'p> ToPyObject for u64
[src]
Conversion of Rust integer to Python int
.
On Python 2.x, may also result in a long
if the value does not fit into a Python int
.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
impl ToPyObject for f64
[src]
Conversion of Rust f64
to Python float
.
type ObjectType = PyFloat
pub fn to_py_object(&self, py: Python<'_>) -> PyFloat
[src]
impl ToPyObject for f32
[src]
Conversion of Rust f32
to Python float
.
type ObjectType = PyFloat
pub fn to_py_object(&self, py: Python<'_>) -> PyFloat
[src]
impl<V, H> ToPyObject for HashSet<V, H> where
V: Hash + Eq + ToPyObject,
H: BuildHasher,
[src]
V: Hash + Eq + ToPyObject,
H: BuildHasher,
type ObjectType = PySet
pub fn to_py_object(&self, py: Python<'_>) -> PySet
[src]
impl<V> ToPyObject for BTreeSet<V> where
V: Eq + ToPyObject,
[src]
V: Eq + ToPyObject,
type ObjectType = PySet
pub fn to_py_object(&self, py: Python<'_>) -> PySet
[src]
impl ToPyObject for str
[src]
Converts Rust str
to Python object.
On Python 2.7, this impl will create a byte string if the
input string is ASCII-only; and a unicode string otherwise.
Use PyUnicode::new()
to always create a unicode string.
On Python 3.x, this function always creates unicode str
objects.
type ObjectType = PyString
pub fn to_py_object(&self, py: Python<'_>) -> PyString
[src]
impl<'a> ToPyObject for Cow<'a, str>
[src]
Converts Rust str
to Python object.
On Python 2.7, this impl will create a byte string if the
input string is ASCII-only; and a unicode string otherwise.
Use PyUnicode::new()
to always create a unicode string.
On Python 3.x, this function always creates unicode str
objects.
type ObjectType = PyString
pub fn to_py_object(&self, py: Python<'_>) -> PyString
[src]
impl ToPyObject for String
[src]
Converts Rust str
to Python object.
On Python 2.7, this impl will create a byte string if the
input string is ASCII-only; and a unicode string otherwise.
Use PyUnicode::new()
to always create a unicode string.
On Python 3.x, this function always creates unicode str
objects.
type ObjectType = PyString
pub fn to_py_object(&self, py: Python<'_>) -> PyString
[src]
impl<A: ToPyObject> ToPyObject for (A,)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject> ToPyObject for (A, B)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject> ToPyObject for (A, B, C)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject> ToPyObject for (A, B, C, D)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject> ToPyObject for (A, B, C, D, E)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject> ToPyObject for (A, B, C, D, E, F)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject> ToPyObject for (A, B, C, D, E, F, G)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject, H: ToPyObject> ToPyObject for (A, B, C, D, E, F, G, H)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject, H: ToPyObject, I: ToPyObject> ToPyObject for (A, B, C, D, E, F, G, H, I)
[src]
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, py: Python<'_>) -> PyTuple
[src]
Implementors
impl ToPyObject for AssertionError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AssertionError
pub fn to_py_object(&self, py: Python<'_>) -> AssertionError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> AssertionError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for AttributeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AttributeError
pub fn to_py_object(&self, py: Python<'_>) -> AttributeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> AttributeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for BaseException
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BaseException
pub fn to_py_object(&self, py: Python<'_>) -> BaseException
[src]
pub fn into_py_object(self, _py: Python<'_>) -> BaseException
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for BlockingIOError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BlockingIOError
pub fn to_py_object(&self, py: Python<'_>) -> BlockingIOError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> BlockingIOError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for BrokenPipeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BrokenPipeError
pub fn to_py_object(&self, py: Python<'_>) -> BrokenPipeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> BrokenPipeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for BufferError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BufferError
pub fn to_py_object(&self, py: Python<'_>) -> BufferError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> BufferError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ChildProcessError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ChildProcessError
pub fn to_py_object(&self, py: Python<'_>) -> ChildProcessError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ChildProcessError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ConnectionAbortedError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionAbortedError
pub fn to_py_object(&self, py: Python<'_>) -> ConnectionAbortedError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ConnectionAbortedError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ConnectionError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionError
pub fn to_py_object(&self, py: Python<'_>) -> ConnectionError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ConnectionError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ConnectionRefusedError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionRefusedError
pub fn to_py_object(&self, py: Python<'_>) -> ConnectionRefusedError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ConnectionRefusedError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ConnectionResetError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionResetError
pub fn to_py_object(&self, py: Python<'_>) -> ConnectionResetError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ConnectionResetError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for EOFError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EOFError
pub fn to_py_object(&self, py: Python<'_>) -> EOFError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> EOFError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for EnvironmentError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EnvironmentError
pub fn to_py_object(&self, py: Python<'_>) -> EnvironmentError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> EnvironmentError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for Exception
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = Exception
pub fn to_py_object(&self, py: Python<'_>) -> Exception
[src]
pub fn into_py_object(self, _py: Python<'_>) -> Exception
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for FileExistsError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileExistsError
pub fn to_py_object(&self, py: Python<'_>) -> FileExistsError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> FileExistsError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for FileNotFoundError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileNotFoundError
pub fn to_py_object(&self, py: Python<'_>) -> FileNotFoundError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> FileNotFoundError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for FloatingPointError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FloatingPointError
pub fn to_py_object(&self, py: Python<'_>) -> FloatingPointError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> FloatingPointError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for IOError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IOError
pub fn to_py_object(&self, py: Python<'_>) -> IOError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> IOError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ImportError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ImportError
pub fn to_py_object(&self, py: Python<'_>) -> ImportError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ImportError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for IndexError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IndexError
pub fn to_py_object(&self, py: Python<'_>) -> IndexError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> IndexError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for InterruptedError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = InterruptedError
pub fn to_py_object(&self, py: Python<'_>) -> InterruptedError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> InterruptedError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for IsADirectoryError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IsADirectoryError
pub fn to_py_object(&self, py: Python<'_>) -> IsADirectoryError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> IsADirectoryError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for KeyError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyError
pub fn to_py_object(&self, py: Python<'_>) -> KeyError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> KeyError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for KeyboardInterrupt
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyboardInterrupt
pub fn to_py_object(&self, py: Python<'_>) -> KeyboardInterrupt
[src]
pub fn into_py_object(self, _py: Python<'_>) -> KeyboardInterrupt
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for LookupError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = LookupError
pub fn to_py_object(&self, py: Python<'_>) -> LookupError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> LookupError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for MemoryError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = MemoryError
pub fn to_py_object(&self, py: Python<'_>) -> MemoryError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> MemoryError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for NameError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NameError
pub fn to_py_object(&self, py: Python<'_>) -> NameError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> NameError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for NotADirectoryError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotADirectoryError
pub fn to_py_object(&self, py: Python<'_>) -> NotADirectoryError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> NotADirectoryError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for NotImplementedError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotImplementedError
pub fn to_py_object(&self, py: Python<'_>) -> NotImplementedError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> NotImplementedError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for OSError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OSError
pub fn to_py_object(&self, py: Python<'_>) -> OSError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> OSError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for OverflowError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OverflowError
pub fn to_py_object(&self, py: Python<'_>) -> OverflowError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> OverflowError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PermissionError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PermissionError
pub fn to_py_object(&self, py: Python<'_>) -> PermissionError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PermissionError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ProcessLookupError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ProcessLookupError
pub fn to_py_object(&self, py: Python<'_>) -> ProcessLookupError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ProcessLookupError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ReferenceError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ReferenceError
pub fn to_py_object(&self, py: Python<'_>) -> ReferenceError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ReferenceError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for RuntimeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = RuntimeError
pub fn to_py_object(&self, py: Python<'_>) -> RuntimeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> RuntimeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for SyntaxError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SyntaxError
pub fn to_py_object(&self, py: Python<'_>) -> SyntaxError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> SyntaxError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for SystemError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemError
pub fn to_py_object(&self, py: Python<'_>) -> SystemError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> SystemError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for SystemExit
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemExit
pub fn to_py_object(&self, py: Python<'_>) -> SystemExit
[src]
pub fn into_py_object(self, _py: Python<'_>) -> SystemExit
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for TimeoutError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TimeoutError
pub fn to_py_object(&self, py: Python<'_>) -> TimeoutError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> TimeoutError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for TypeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TypeError
pub fn to_py_object(&self, py: Python<'_>) -> TypeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> TypeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for UnicodeDecodeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeDecodeError
pub fn to_py_object(&self, py: Python<'_>) -> UnicodeDecodeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> UnicodeDecodeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for UnicodeEncodeError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeEncodeError
pub fn to_py_object(&self, py: Python<'_>) -> UnicodeEncodeError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> UnicodeEncodeError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for UnicodeTranslateError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeTranslateError
pub fn to_py_object(&self, py: Python<'_>) -> UnicodeTranslateError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> UnicodeTranslateError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ValueError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ValueError
pub fn to_py_object(&self, py: Python<'_>) -> ValueError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ValueError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for WindowsError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = WindowsError
pub fn to_py_object(&self, py: Python<'_>) -> WindowsError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> WindowsError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for ZeroDivisionError
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ZeroDivisionError
pub fn to_py_object(&self, py: Python<'_>) -> ZeroDivisionError
[src]
pub fn into_py_object(self, _py: Python<'_>) -> ZeroDivisionError
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for NoArgs
[src]
Converts NoArgs
to an empty Python tuple.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
impl ToPyObject for PyBool
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBool
pub fn to_py_object(&self, py: Python<'_>) -> PyBool
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyBool
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyBytes
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBytes
pub fn to_py_object(&self, py: Python<'_>) -> PyBytes
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyBytes
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyCapsule
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyCapsule
pub fn to_py_object(&self, py: Python<'_>) -> PyCapsule
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyCapsule
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyDict
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyDict
pub fn to_py_object(&self, py: Python<'_>) -> PyDict
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyDict
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyFloat
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyFloat
pub fn to_py_object(&self, py: Python<'_>) -> PyFloat
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyFloat
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyLong
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyLong
pub fn to_py_object(&self, py: Python<'_>) -> PyLong
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyLong
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyList
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyList
pub fn to_py_object(&self, py: Python<'_>) -> PyList
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyList
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyModule
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyModule
pub fn to_py_object(&self, py: Python<'_>) -> PyModule
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyModule
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyObject
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyObject
pub fn to_py_object(&self, py: Python<'_>) -> PyObject
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyObject
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PySequence
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySequence
pub fn to_py_object(&self, py: Python<'_>) -> PySequence
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PySequence
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PySet
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySet
pub fn to_py_object(&self, py: Python<'_>) -> PySet
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PySet
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyTuple
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyTuple
pub fn to_py_object(&self, py: Python<'_>) -> PyTuple
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyTuple
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyType
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyType
pub fn to_py_object(&self, py: Python<'_>) -> PyType
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyType
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,
impl ToPyObject for PyString
[src]
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyString
pub fn to_py_object(&self, py: Python<'_>) -> PyString
[src]
pub fn into_py_object(self, _py: Python<'_>) -> PyString
[src]
pub fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,