pub trait ToPyObject {
type ObjectType: PythonObject;
// Required method
fn to_py_object(&self, py: Python<'_>) -> Self::ObjectType;
// Provided methods
fn into_py_object(self, py: Python<'_>) -> Self::ObjectType
where Self: Sized { ... }
fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> R
where F: FnOnce(*mut PyObject) -> R { ... }
}
Expand description
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
).
Required Associated Types§
type ObjectType: PythonObject
Required Methods§
Sourcefn to_py_object(&self, py: Python<'_>) -> Self::ObjectType
fn to_py_object(&self, py: Python<'_>) -> Self::ObjectType
Converts self into a Python object.
Provided Methods§
Sourcefn into_py_object(self, py: Python<'_>) -> Self::ObjectTypewhere
Self: Sized,
fn into_py_object(self, py: Python<'_>) -> Self::ObjectTypewhere
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.
Sourcefn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> R
fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ToPyObject for bool
Converts a rust bool
to a Python bool
.
impl ToPyObject for bool
Converts a rust bool
to a Python bool
.
Source§impl ToPyObject for f32
Conversion of Rust f32
to Python float
.
impl ToPyObject for f32
Conversion of Rust f32
to Python float
.
type ObjectType = PyFloat
fn to_py_object(&self, py: Python<'_>) -> PyFloat
Source§impl ToPyObject for f64
Conversion of Rust f64
to Python float
.
impl ToPyObject for f64
Conversion of Rust f64
to Python float
.
type ObjectType = PyFloat
fn to_py_object(&self, py: Python<'_>) -> PyFloat
Source§impl ToPyObject for i8
Conversion of Rust integer to Python int
.
impl ToPyObject for i8
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for i16
Conversion of Rust integer to Python int
.
impl ToPyObject for i16
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for i32
Conversion of Rust integer to Python int
.
impl ToPyObject for i32
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for i64
Conversion of Rust integer to Python int
.
impl ToPyObject for i64
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for isize
Conversion of Rust integer to Python int
.
impl ToPyObject for isize
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for str
Converts Rust str
to Python object.
impl ToPyObject for str
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
fn to_py_object(&self, py: Python<'_>) -> PyString
Source§impl ToPyObject for u8
Conversion of Rust integer to Python int
.
impl ToPyObject for u8
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for u16
Conversion of Rust integer to Python int
.
impl ToPyObject for u16
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for u32
Conversion of Rust integer to Python int
.
impl ToPyObject for u32
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl ToPyObject for usize
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
.
impl ToPyObject for usize
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
fn to_py_object(&self, py: Python<'_>) -> <u64 as ToPyObject>::ObjectType
Source§impl ToPyObject for String
Converts Rust str
to Python object.
impl ToPyObject for String
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
fn to_py_object(&self, py: Python<'_>) -> PyString
Source§impl<'a> ToPyObject for Cow<'a, str>
Converts Rust str
to Python object.
impl<'a> ToPyObject for Cow<'a, str>
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
fn to_py_object(&self, py: Python<'_>) -> PyString
Source§impl<'a, T> ToPyObject for &'a Twhere
T: ToPyObject + ?Sized,
ToPyObject
for references: calls to_py_object() on the underlying T
.
impl<'a, T> ToPyObject for &'a Twhere
T: ToPyObject + ?Sized,
ToPyObject
for references: calls to_py_object() on the underlying T
.
type ObjectType = <T as ToPyObject>::ObjectType
fn to_py_object(&self, py: Python<'_>) -> T::ObjectType
fn into_py_object(self, py: Python<'_>) -> T::ObjectType
fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> R
Source§impl<'p> ToPyObject for u64
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
.
impl<'p> ToPyObject for u64
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
fn to_py_object(&self, py: Python<'_>) -> PyLong
Source§impl<A: ToPyObject> ToPyObject for (A,)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject> ToPyObject for (A,)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject> ToPyObject for (A, B)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject> ToPyObject for (A, B)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject, C: ToPyObject> ToPyObject for (A, B, C)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject> ToPyObject for (A, B, C)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject> ToPyObject for (A, B, C, D)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject> ToPyObject for (A, B, C, D)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject> ToPyObject for (A, B, C, D, E)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject> ToPyObject for (A, B, C, D, E)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject> ToPyObject for (A, B, C, D, E, F)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject> ToPyObject for (A, B, C, D, E, F)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject> ToPyObject for (A, B, C, D, E, F, G)
Converts a Rust tuple to a Python tuple
.
impl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject> ToPyObject for (A, B, C, D, E, F, G)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§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)
Converts a Rust tuple to a Python tuple
.
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)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§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)
Converts a Rust tuple to a Python tuple
.
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)
Converts a Rust tuple to a Python tuple
.
type ObjectType = PyTuple
fn to_py_object(&self, py: Python<'_>) -> PyTuple
fn into_py_object(self, py: Python<'_>) -> PyTuple
Source§impl<K, V> ToPyObject for BTreeMap<K, V>
Converts a Rust BTreeMap
to a Python dict
.
impl<K, V> ToPyObject for BTreeMap<K, V>
Converts a Rust BTreeMap
to a Python dict
.
type ObjectType = PyDict
fn to_py_object(&self, py: Python<'_>) -> PyDict
Source§impl<K, V, H> ToPyObject for HashMap<K, V, H>
Converts a Rust HashMap
to a Python dict
.
impl<K, V, H> ToPyObject for HashMap<K, V, H>
Converts a Rust HashMap
to a Python dict
.
type ObjectType = PyDict
fn to_py_object(&self, py: Python<'_>) -> PyDict
Source§impl<T> ToPyObject for Option<T>where
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
impl<T> ToPyObject for Option<T>where
T: ToPyObject,
Option::Some<T>
is converted like T
.
Option::None
is converted to Python None
.
type ObjectType = PyObject
fn to_py_object(&self, py: Python<'_>) -> PyObject
fn into_py_object(self, py: Python<'_>) -> PyObject
Source§impl<T> ToPyObject for [T]where
T: ToPyObject,
Converts a Rust slice to a Python list
.
impl<T> ToPyObject for [T]where
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
fn to_py_object(&self, py: Python<'_>) -> PyList
Source§impl<T> ToPyObject for Vec<T>where
T: ToPyObject,
Converts a Rust slice to a Python list
.
impl<T> ToPyObject for Vec<T>where
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
fn to_py_object(&self, py: Python<'_>) -> PyList
fn into_py_object(self, py: Python<'_>) -> PyList
Source§impl<V> ToPyObject for BTreeSet<V>where
V: Eq + ToPyObject,
impl<V> ToPyObject for BTreeSet<V>where
V: Eq + ToPyObject,
type ObjectType = PySet
fn to_py_object(&self, py: Python<'_>) -> PySet
Source§impl<V, H> ToPyObject for HashSet<V, H>
impl<V, H> ToPyObject for HashSet<V, H>
type ObjectType = PySet
fn to_py_object(&self, py: Python<'_>) -> PySet
Implementors§
Source§impl ToPyObject for AssertionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for AssertionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AssertionError
Source§impl ToPyObject for AttributeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for AttributeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AttributeError
Source§impl ToPyObject for BaseException
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for BaseException
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BaseException
Source§impl ToPyObject for BlockingIOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for BlockingIOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BlockingIOError
Source§impl ToPyObject for BrokenPipeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for BrokenPipeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BrokenPipeError
Source§impl ToPyObject for BufferError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for BufferError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BufferError
Source§impl ToPyObject for ChildProcessError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ChildProcessError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for ConnectionAbortedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ConnectionAbortedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for ConnectionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ConnectionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionError
Source§impl ToPyObject for ConnectionRefusedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ConnectionRefusedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for ConnectionResetError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ConnectionResetError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for EOFError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for EOFError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EOFError
Source§impl ToPyObject for EnvironmentError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for EnvironmentError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for Exception
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for Exception
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = Exception
Source§impl ToPyObject for FileExistsError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for FileExistsError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileExistsError
Source§impl ToPyObject for FileNotFoundError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for FileNotFoundError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for FloatingPointError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for FloatingPointError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for IOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for IOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IOError
Source§impl ToPyObject for ImportError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ImportError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ImportError
Source§impl ToPyObject for IndexError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for IndexError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IndexError
Source§impl ToPyObject for InterruptedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for InterruptedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for IsADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for IsADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for KeyError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for KeyError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyError
Source§impl ToPyObject for KeyboardInterrupt
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for KeyboardInterrupt
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for LookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for LookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = LookupError
Source§impl ToPyObject for MemoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for MemoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = MemoryError
Source§impl ToPyObject for NameError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for NameError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NameError
Source§impl ToPyObject for NotADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for NotADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for NotImplementedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for NotImplementedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for OSError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for OSError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OSError
Source§impl ToPyObject for OverflowError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for OverflowError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OverflowError
Source§impl ToPyObject for PermissionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PermissionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PermissionError
Source§impl ToPyObject for ProcessLookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ProcessLookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for ReferenceError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ReferenceError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ReferenceError
Source§impl ToPyObject for RuntimeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for RuntimeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = RuntimeError
Source§impl ToPyObject for SyntaxError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for SyntaxError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SyntaxError
Source§impl ToPyObject for SystemError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for SystemError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemError
Source§impl ToPyObject for SystemExit
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for SystemExit
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemExit
Source§impl ToPyObject for TimeoutError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for TimeoutError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TimeoutError
Source§impl ToPyObject for TypeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for TypeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TypeError
Source§impl ToPyObject for UnicodeDecodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for UnicodeDecodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for UnicodeEncodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for UnicodeEncodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for UnicodeTranslateError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for UnicodeTranslateError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for ValueError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ValueError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ValueError
Source§impl ToPyObject for ZeroDivisionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for ZeroDivisionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
Source§impl ToPyObject for NoArgs
Converts NoArgs
to an empty Python tuple.
impl ToPyObject for NoArgs
Converts NoArgs
to an empty Python tuple.
type ObjectType = PyTuple
Source§impl ToPyObject for PyBool
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyBool
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBool
Source§impl ToPyObject for PyBytes
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyBytes
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBytes
Source§impl ToPyObject for PyCapsule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyCapsule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyCapsule
Source§impl ToPyObject for PyDict
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyDict
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyDict
Source§impl ToPyObject for PyFloat
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyFloat
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyFloat
Source§impl ToPyObject for PyLong
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyLong
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyLong
Source§impl ToPyObject for PyList
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyList
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyList
Source§impl ToPyObject for PyModule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyModule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyModule
Source§impl ToPyObject for PyNone
impl ToPyObject for PyNone
type ObjectType = PyObject
Source§impl ToPyObject for PyObject
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyObject
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyObject
Source§impl ToPyObject for PySequence
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PySequence
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySequence
Source§impl ToPyObject for PySet
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PySet
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySet
Source§impl ToPyObject for PyTuple
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyTuple
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyTuple
Source§impl ToPyObject for PyType
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyType
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyType
Source§impl ToPyObject for PyString
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
impl ToPyObject for PyString
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.