Trait cpython::ToPyObject
source · [−]pub trait ToPyObject {
type ObjectType: PythonObject;
fn to_py_object(&self, py: Python<'_>) -> Self::ObjectType;
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) -> Rwhere
F: FnOnce(*mut PyObject) -> R,
fn with_borrowed_ptr<F, R>(&self, py: Python<'_>, f: F) -> Rwhere
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
sourceimpl<'a, T: ?Sized> ToPyObject for &'a Twhere
T: ToPyObject,
impl<'a, T: ?Sized> ToPyObject for &'a Twhere
T: ToPyObject,
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) -> Rwhere
F: FnOnce(*mut PyObject) -> R,
sourceimpl<T> ToPyObject for Option<T>where
T: ToPyObject,
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
sourceimpl ToPyObject for bool
impl ToPyObject for bool
Converts a rust bool
to a Python bool
.
type ObjectType = PyBool
fn to_py_object(&self, py: Python<'_>) -> PyBool
fn with_borrowed_ptr<F, R>(&self, _py: Python<'_>, f: F) -> Rwhere
F: FnOnce(*mut PyObject) -> R,
sourceimpl<K, V, H> ToPyObject for HashMap<K, V, H>where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
impl<K, V, H> ToPyObject for HashMap<K, V, H>where
K: Hash + Eq + ToPyObject,
V: ToPyObject,
H: BuildHasher,
Converts a Rust HashMap
to a Python dict
.
type ObjectType = PyDict
fn to_py_object(&self, py: Python<'_>) -> PyDict
sourceimpl<K, V> ToPyObject for BTreeMap<K, V>where
K: Eq + ToPyObject,
V: ToPyObject,
impl<K, V> ToPyObject for BTreeMap<K, V>where
K: Eq + ToPyObject,
V: ToPyObject,
Converts a Rust BTreeMap
to a Python dict
.
type ObjectType = PyDict
fn to_py_object(&self, py: Python<'_>) -> PyDict
sourceimpl<T> ToPyObject for [T]where
T: ToPyObject,
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
sourceimpl<T> ToPyObject for Vec<T>where
T: ToPyObject,
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
sourceimpl ToPyObject for i8
impl ToPyObject for i8
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
sourceimpl ToPyObject for u8
impl ToPyObject for u8
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
sourceimpl ToPyObject for i16
impl ToPyObject for i16
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
sourceimpl ToPyObject for u16
impl ToPyObject for u16
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
sourceimpl ToPyObject for i32
impl ToPyObject for i32
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python<'_>) -> PyLong
sourceimpl ToPyObject for u32
impl ToPyObject for u32
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
sourceimpl<'p> ToPyObject for i64
impl<'p> ToPyObject for i64
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
sourceimpl ToPyObject for isize
impl ToPyObject for isize
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
fn to_py_object(&self, py: Python<'_>) -> <i64 as ToPyObject>::ObjectType
sourceimpl ToPyObject for usize
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
sourceimpl<'p> ToPyObject for u64
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
sourceimpl ToPyObject for f64
impl ToPyObject for f64
Conversion of Rust f64
to Python float
.
type ObjectType = PyFloat
fn to_py_object(&self, py: Python<'_>) -> PyFloat
sourceimpl ToPyObject for f32
impl ToPyObject for f32
Conversion of Rust f32
to Python float
.
type ObjectType = PyFloat
fn to_py_object(&self, py: Python<'_>) -> PyFloat
sourceimpl<V, H> ToPyObject for HashSet<V, H>where
V: Hash + Eq + ToPyObject,
H: BuildHasher,
impl<V, H> ToPyObject for HashSet<V, H>where
V: Hash + Eq + ToPyObject,
H: BuildHasher,
type ObjectType = PySet
fn to_py_object(&self, py: Python<'_>) -> PySet
sourceimpl<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
sourceimpl ToPyObject for str
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
sourceimpl<'a> ToPyObject for Cow<'a, str>
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
sourceimpl ToPyObject for String
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
sourceimpl<A: ToPyObject> ToPyObject for (A,)
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
sourceimpl<A: ToPyObject, B: ToPyObject> ToPyObject for (A, B)
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
sourceimpl<A: ToPyObject, B: ToPyObject, C: ToPyObject> ToPyObject for (A, B, C)
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
sourceimpl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject> ToPyObject for (A, B, C, D)
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
sourceimpl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject> ToPyObject for (A, B, C, D, E)
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
sourceimpl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject> ToPyObject for (A, B, C, D, E, F)
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
sourceimpl<A: ToPyObject, B: ToPyObject, C: ToPyObject, D: ToPyObject, E: ToPyObject, F: ToPyObject, G: ToPyObject> ToPyObject for (A, B, C, D, E, F, G)
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
sourceimpl<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)
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
sourceimpl<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)
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
Implementors
sourceimpl ToPyObject for AssertionError
impl ToPyObject for AssertionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AssertionError
sourceimpl ToPyObject for AttributeError
impl ToPyObject for AttributeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AttributeError
sourceimpl ToPyObject for BaseException
impl ToPyObject for BaseException
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BaseException
sourceimpl ToPyObject for BlockingIOError
impl ToPyObject for BlockingIOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BlockingIOError
sourceimpl ToPyObject for BrokenPipeError
impl ToPyObject for BrokenPipeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BrokenPipeError
sourceimpl ToPyObject for BufferError
impl ToPyObject for BufferError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BufferError
sourceimpl ToPyObject for ChildProcessError
impl ToPyObject for ChildProcessError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ChildProcessError
sourceimpl ToPyObject for ConnectionAbortedError
impl ToPyObject for ConnectionAbortedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionAbortedError
sourceimpl ToPyObject for ConnectionError
impl ToPyObject for ConnectionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionError
sourceimpl ToPyObject for ConnectionRefusedError
impl ToPyObject for ConnectionRefusedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionRefusedError
sourceimpl ToPyObject for ConnectionResetError
impl ToPyObject for ConnectionResetError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionResetError
sourceimpl ToPyObject for EOFError
impl ToPyObject for EOFError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EOFError
sourceimpl ToPyObject for EnvironmentError
impl ToPyObject for EnvironmentError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EnvironmentError
sourceimpl ToPyObject for Exception
impl ToPyObject for Exception
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = Exception
sourceimpl ToPyObject for FileExistsError
impl ToPyObject for FileExistsError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileExistsError
sourceimpl ToPyObject for FileNotFoundError
impl ToPyObject for FileNotFoundError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileNotFoundError
sourceimpl ToPyObject for FloatingPointError
impl ToPyObject for FloatingPointError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FloatingPointError
sourceimpl ToPyObject for IOError
impl ToPyObject for IOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IOError
sourceimpl ToPyObject for ImportError
impl ToPyObject for ImportError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ImportError
sourceimpl ToPyObject for IndexError
impl ToPyObject for IndexError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IndexError
sourceimpl ToPyObject for InterruptedError
impl ToPyObject for InterruptedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = InterruptedError
sourceimpl ToPyObject for IsADirectoryError
impl ToPyObject for IsADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IsADirectoryError
sourceimpl ToPyObject for KeyError
impl ToPyObject for KeyError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyError
sourceimpl ToPyObject for KeyboardInterrupt
impl ToPyObject for KeyboardInterrupt
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyboardInterrupt
sourceimpl ToPyObject for LookupError
impl ToPyObject for LookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = LookupError
sourceimpl ToPyObject for MemoryError
impl ToPyObject for MemoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = MemoryError
sourceimpl ToPyObject for NameError
impl ToPyObject for NameError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NameError
sourceimpl ToPyObject for NotADirectoryError
impl ToPyObject for NotADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotADirectoryError
sourceimpl ToPyObject for NotImplementedError
impl ToPyObject for NotImplementedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotImplementedError
sourceimpl ToPyObject for OSError
impl ToPyObject for OSError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OSError
sourceimpl ToPyObject for OverflowError
impl ToPyObject for OverflowError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OverflowError
sourceimpl ToPyObject for PermissionError
impl ToPyObject for PermissionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PermissionError
sourceimpl ToPyObject for ProcessLookupError
impl ToPyObject for ProcessLookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ProcessLookupError
sourceimpl ToPyObject for ReferenceError
impl ToPyObject for ReferenceError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ReferenceError
sourceimpl ToPyObject for RuntimeError
impl ToPyObject for RuntimeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = RuntimeError
sourceimpl ToPyObject for SyntaxError
impl ToPyObject for SyntaxError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SyntaxError
sourceimpl ToPyObject for SystemError
impl ToPyObject for SystemError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemError
sourceimpl ToPyObject for SystemExit
impl ToPyObject for SystemExit
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemExit
sourceimpl ToPyObject for TimeoutError
impl ToPyObject for TimeoutError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TimeoutError
sourceimpl ToPyObject for TypeError
impl ToPyObject for TypeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TypeError
sourceimpl ToPyObject for UnicodeDecodeError
impl ToPyObject for UnicodeDecodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeDecodeError
sourceimpl ToPyObject for UnicodeEncodeError
impl ToPyObject for UnicodeEncodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeEncodeError
sourceimpl ToPyObject for UnicodeTranslateError
impl ToPyObject for UnicodeTranslateError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeTranslateError
sourceimpl ToPyObject for ValueError
impl ToPyObject for ValueError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ValueError
sourceimpl ToPyObject for WindowsError
impl ToPyObject for WindowsError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = WindowsError
sourceimpl ToPyObject for ZeroDivisionError
impl ToPyObject for ZeroDivisionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ZeroDivisionError
sourceimpl ToPyObject for PyBool
impl ToPyObject for PyBool
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBool
sourceimpl ToPyObject for PyBytes
impl ToPyObject for PyBytes
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBytes
sourceimpl ToPyObject for PyCapsule
impl ToPyObject for PyCapsule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyCapsule
sourceimpl ToPyObject for PyDict
impl ToPyObject for PyDict
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyDict
sourceimpl ToPyObject for PyFloat
impl ToPyObject for PyFloat
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyFloat
sourceimpl ToPyObject for PyLong
impl ToPyObject for PyLong
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyLong
sourceimpl ToPyObject for PyList
impl ToPyObject for PyList
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyList
sourceimpl ToPyObject for PyModule
impl ToPyObject for PyModule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyModule
sourceimpl ToPyObject for PyNone
impl ToPyObject for PyNone
type ObjectType = PyObject
sourceimpl ToPyObject for PyObject
impl ToPyObject for PyObject
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyObject
sourceimpl ToPyObject for PySequence
impl ToPyObject for PySequence
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySequence
sourceimpl ToPyObject for PySet
impl ToPyObject for PySet
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySet
sourceimpl ToPyObject for PyTuple
impl ToPyObject for PyTuple
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyTuple
sourceimpl ToPyObject for PyType
impl ToPyObject for PyType
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyType
sourceimpl ToPyObject for PyString
impl ToPyObject for PyString
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.