Trait cpython::ToPyObject
source · 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.
Object Safety§
Implementations on Foreign Types§
source§impl 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) -> R
source§impl 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
source§impl 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
source§impl 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
source§impl 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
source§impl 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
source§impl ToPyObject for i64
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
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
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
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
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
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
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
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>
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,
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
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,)
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)
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)
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)
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)
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)
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)
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)
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)
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>
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>
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,
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,
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,
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
impl ToPyObject for AssertionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AssertionError
source§impl ToPyObject for AttributeError
impl ToPyObject for AttributeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = AttributeError
source§impl ToPyObject for BaseException
impl ToPyObject for BaseException
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BaseException
source§impl ToPyObject for BlockingIOError
impl ToPyObject for BlockingIOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BlockingIOError
source§impl ToPyObject for BrokenPipeError
impl ToPyObject for BrokenPipeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BrokenPipeError
source§impl ToPyObject for BufferError
impl ToPyObject for BufferError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = BufferError
source§impl ToPyObject for ChildProcessError
impl ToPyObject for ChildProcessError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ChildProcessError
source§impl ToPyObject for ConnectionAbortedError
impl ToPyObject for ConnectionAbortedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
source§impl ToPyObject for ConnectionError
impl ToPyObject for ConnectionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionError
source§impl ToPyObject for ConnectionRefusedError
impl ToPyObject for ConnectionRefusedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
source§impl ToPyObject for ConnectionResetError
impl ToPyObject for ConnectionResetError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ConnectionResetError
source§impl ToPyObject for EOFError
impl ToPyObject for EOFError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EOFError
source§impl ToPyObject for EnvironmentError
impl ToPyObject for EnvironmentError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = EnvironmentError
source§impl ToPyObject for Exception
impl ToPyObject for Exception
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = Exception
source§impl ToPyObject for FileExistsError
impl ToPyObject for FileExistsError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileExistsError
source§impl ToPyObject for FileNotFoundError
impl ToPyObject for FileNotFoundError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FileNotFoundError
source§impl ToPyObject for FloatingPointError
impl ToPyObject for FloatingPointError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = FloatingPointError
source§impl ToPyObject for IOError
impl ToPyObject for IOError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IOError
source§impl ToPyObject for ImportError
impl ToPyObject for ImportError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ImportError
source§impl ToPyObject for IndexError
impl ToPyObject for IndexError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IndexError
source§impl ToPyObject for InterruptedError
impl ToPyObject for InterruptedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = InterruptedError
source§impl ToPyObject for IsADirectoryError
impl ToPyObject for IsADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = IsADirectoryError
source§impl ToPyObject for KeyError
impl ToPyObject for KeyError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyError
source§impl ToPyObject for KeyboardInterrupt
impl ToPyObject for KeyboardInterrupt
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = KeyboardInterrupt
source§impl ToPyObject for LookupError
impl ToPyObject for LookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = LookupError
source§impl ToPyObject for MemoryError
impl ToPyObject for MemoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = MemoryError
source§impl ToPyObject for NameError
impl ToPyObject for NameError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NameError
source§impl ToPyObject for NotADirectoryError
impl ToPyObject for NotADirectoryError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotADirectoryError
source§impl ToPyObject for NotImplementedError
impl ToPyObject for NotImplementedError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = NotImplementedError
source§impl ToPyObject for OSError
impl ToPyObject for OSError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OSError
source§impl ToPyObject for OverflowError
impl ToPyObject for OverflowError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = OverflowError
source§impl ToPyObject for PermissionError
impl ToPyObject for PermissionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PermissionError
source§impl ToPyObject for ProcessLookupError
impl ToPyObject for ProcessLookupError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ProcessLookupError
source§impl ToPyObject for ReferenceError
impl ToPyObject for ReferenceError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ReferenceError
source§impl ToPyObject for RuntimeError
impl ToPyObject for RuntimeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = RuntimeError
source§impl ToPyObject for SyntaxError
impl ToPyObject for SyntaxError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SyntaxError
source§impl ToPyObject for SystemError
impl ToPyObject for SystemError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemError
source§impl ToPyObject for SystemExit
impl ToPyObject for SystemExit
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = SystemExit
source§impl ToPyObject for TimeoutError
impl ToPyObject for TimeoutError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TimeoutError
source§impl ToPyObject for TypeError
impl ToPyObject for TypeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = TypeError
source§impl ToPyObject for UnicodeDecodeError
impl ToPyObject for UnicodeDecodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeDecodeError
source§impl ToPyObject for UnicodeEncodeError
impl ToPyObject for UnicodeEncodeError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeEncodeError
source§impl ToPyObject for UnicodeTranslateError
impl ToPyObject for UnicodeTranslateError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = UnicodeTranslateError
source§impl ToPyObject for ValueError
impl ToPyObject for ValueError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ValueError
source§impl ToPyObject for ZeroDivisionError
impl ToPyObject for ZeroDivisionError
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = ZeroDivisionError
source§impl ToPyObject for NoArgs
impl ToPyObject for NoArgs
Converts NoArgs
to an empty Python tuple.
type ObjectType = PyTuple
source§impl ToPyObject for PyBool
impl ToPyObject for PyBool
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBool
source§impl ToPyObject for PyBytes
impl ToPyObject for PyBytes
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyBytes
source§impl ToPyObject for PyCapsule
impl ToPyObject for PyCapsule
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyCapsule
source§impl ToPyObject for PyDict
impl ToPyObject for PyDict
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyDict
source§impl ToPyObject for PyFloat
impl ToPyObject for PyFloat
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyFloat
source§impl ToPyObject for PyLong
impl ToPyObject for PyLong
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyLong
source§impl ToPyObject for PyList
impl ToPyObject for PyList
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyList
source§impl ToPyObject for PyModule
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
impl ToPyObject for PyObject
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyObject
source§impl ToPyObject for PySequence
impl ToPyObject for PySequence
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySequence
source§impl ToPyObject for PySet
impl ToPyObject for PySet
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PySet
source§impl ToPyObject for PyTuple
impl ToPyObject for PyTuple
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyTuple
source§impl ToPyObject for PyType
impl ToPyObject for PyType
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.
type ObjectType = PyType
source§impl ToPyObject for PyString
impl ToPyObject for PyString
Identity conversion: allows using existing PyObject
instances where
T: ToPyObject
is expected.