[−][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
Required methods
fn to_py_object(&self, py: Python) -> Self::ObjectType
Converts self into a Python object.
Provided methods
fn into_py_object(self, py: Python) -> Self::ObjectType where
Self: Sized,
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.
fn with_borrowed_ptr<F, R>(&self, py: Python, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
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
fn to_py_object(&self, py: Python) -> T::ObjectType
[src]
fn into_py_object(self, py: Python) -> T::ObjectType
[src]
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
fn to_py_object(&self, py: Python) -> PyObject
[src]
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
fn to_py_object(&self, py: Python) -> PyBool
[src]
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
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
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
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
fn to_py_object(&self, py: Python) -> PyList
[src]
fn into_py_object(self, py: Python) -> PyList
[src]
impl ToPyObject for i8
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for u8
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for i16
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for u16
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for i32
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for u32
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for i64
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for isize
[src]
Conversion of Rust integer to Python int
.
type ObjectType = PyLong
fn to_py_object(&self, py: Python) -> PyLong
[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
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
fn to_py_object(&self, py: Python) -> PyLong
[src]
impl ToPyObject for f64
[src]
Conversion of Rust f64
to Python float
.
type ObjectType = PyFloat
fn to_py_object(&self, py: Python) -> PyFloat
[src]
impl ToPyObject for f32
[src]
Conversion of Rust f32
to Python float
.
type ObjectType = PyFloat
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
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
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
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
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
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> AssertionError
[src]
fn into_py_object(self, _py: Python) -> AssertionError
[src]
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
fn to_py_object(&self, py: Python) -> AttributeError
[src]
fn into_py_object(self, _py: Python) -> AttributeError
[src]
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
fn to_py_object(&self, py: Python) -> BaseException
[src]
fn into_py_object(self, _py: Python) -> BaseException
[src]
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
fn to_py_object(&self, py: Python) -> BlockingIOError
[src]
fn into_py_object(self, _py: Python) -> BlockingIOError
[src]
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
fn to_py_object(&self, py: Python) -> BrokenPipeError
[src]
fn into_py_object(self, _py: Python) -> BrokenPipeError
[src]
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
fn to_py_object(&self, py: Python) -> BufferError
[src]
fn into_py_object(self, _py: Python) -> BufferError
[src]
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
fn to_py_object(&self, py: Python) -> ChildProcessError
[src]
fn into_py_object(self, _py: Python) -> ChildProcessError
[src]
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
fn to_py_object(&self, py: Python) -> ConnectionAbortedError
[src]
fn into_py_object(self, _py: Python) -> ConnectionAbortedError
[src]
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
fn to_py_object(&self, py: Python) -> ConnectionError
[src]
fn into_py_object(self, _py: Python) -> ConnectionError
[src]
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
fn to_py_object(&self, py: Python) -> ConnectionRefusedError
[src]
fn into_py_object(self, _py: Python) -> ConnectionRefusedError
[src]
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
fn to_py_object(&self, py: Python) -> ConnectionResetError
[src]
fn into_py_object(self, _py: Python) -> ConnectionResetError
[src]
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
fn to_py_object(&self, py: Python) -> EOFError
[src]
fn into_py_object(self, _py: Python) -> EOFError
[src]
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
fn to_py_object(&self, py: Python) -> EnvironmentError
[src]
fn into_py_object(self, _py: Python) -> EnvironmentError
[src]
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
fn to_py_object(&self, py: Python) -> Exception
[src]
fn into_py_object(self, _py: Python) -> Exception
[src]
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
fn to_py_object(&self, py: Python) -> FileExistsError
[src]
fn into_py_object(self, _py: Python) -> FileExistsError
[src]
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
fn to_py_object(&self, py: Python) -> FileNotFoundError
[src]
fn into_py_object(self, _py: Python) -> FileNotFoundError
[src]
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
fn to_py_object(&self, py: Python) -> FloatingPointError
[src]
fn into_py_object(self, _py: Python) -> FloatingPointError
[src]
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
fn to_py_object(&self, py: Python) -> IOError
[src]
fn into_py_object(self, _py: Python) -> IOError
[src]
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
fn to_py_object(&self, py: Python) -> ImportError
[src]
fn into_py_object(self, _py: Python) -> ImportError
[src]
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
fn to_py_object(&self, py: Python) -> IndexError
[src]
fn into_py_object(self, _py: Python) -> IndexError
[src]
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
fn to_py_object(&self, py: Python) -> InterruptedError
[src]
fn into_py_object(self, _py: Python) -> InterruptedError
[src]
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
fn to_py_object(&self, py: Python) -> IsADirectoryError
[src]
fn into_py_object(self, _py: Python) -> IsADirectoryError
[src]
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
fn to_py_object(&self, py: Python) -> KeyError
[src]
fn into_py_object(self, _py: Python) -> KeyError
[src]
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
fn to_py_object(&self, py: Python) -> KeyboardInterrupt
[src]
fn into_py_object(self, _py: Python) -> KeyboardInterrupt
[src]
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
fn to_py_object(&self, py: Python) -> LookupError
[src]
fn into_py_object(self, _py: Python) -> LookupError
[src]
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
fn to_py_object(&self, py: Python) -> MemoryError
[src]
fn into_py_object(self, _py: Python) -> MemoryError
[src]
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
fn to_py_object(&self, py: Python) -> NameError
[src]
fn into_py_object(self, _py: Python) -> NameError
[src]
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
fn to_py_object(&self, py: Python) -> NotADirectoryError
[src]
fn into_py_object(self, _py: Python) -> NotADirectoryError
[src]
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
fn to_py_object(&self, py: Python) -> NotImplementedError
[src]
fn into_py_object(self, _py: Python) -> NotImplementedError
[src]
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
fn to_py_object(&self, py: Python) -> OSError
[src]
fn into_py_object(self, _py: Python) -> OSError
[src]
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
fn to_py_object(&self, py: Python) -> OverflowError
[src]
fn into_py_object(self, _py: Python) -> OverflowError
[src]
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
fn to_py_object(&self, py: Python) -> PermissionError
[src]
fn into_py_object(self, _py: Python) -> PermissionError
[src]
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
fn to_py_object(&self, py: Python) -> ProcessLookupError
[src]
fn into_py_object(self, _py: Python) -> ProcessLookupError
[src]
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
fn to_py_object(&self, py: Python) -> ReferenceError
[src]
fn into_py_object(self, _py: Python) -> ReferenceError
[src]
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
fn to_py_object(&self, py: Python) -> RuntimeError
[src]
fn into_py_object(self, _py: Python) -> RuntimeError
[src]
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
fn to_py_object(&self, py: Python) -> SyntaxError
[src]
fn into_py_object(self, _py: Python) -> SyntaxError
[src]
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
fn to_py_object(&self, py: Python) -> SystemError
[src]
fn into_py_object(self, _py: Python) -> SystemError
[src]
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
fn to_py_object(&self, py: Python) -> SystemExit
[src]
fn into_py_object(self, _py: Python) -> SystemExit
[src]
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
fn to_py_object(&self, py: Python) -> TimeoutError
[src]
fn into_py_object(self, _py: Python) -> TimeoutError
[src]
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
fn to_py_object(&self, py: Python) -> TypeError
[src]
fn into_py_object(self, _py: Python) -> TypeError
[src]
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
fn to_py_object(&self, py: Python) -> UnicodeDecodeError
[src]
fn into_py_object(self, _py: Python) -> UnicodeDecodeError
[src]
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
fn to_py_object(&self, py: Python) -> UnicodeEncodeError
[src]
fn into_py_object(self, _py: Python) -> UnicodeEncodeError
[src]
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
fn to_py_object(&self, py: Python) -> UnicodeTranslateError
[src]
fn into_py_object(self, _py: Python) -> UnicodeTranslateError
[src]
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
fn to_py_object(&self, py: Python) -> ValueError
[src]
fn into_py_object(self, _py: Python) -> ValueError
[src]
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
fn to_py_object(&self, py: Python) -> ZeroDivisionError
[src]
fn into_py_object(self, _py: Python) -> ZeroDivisionError
[src]
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
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
fn to_py_object(&self, py: Python) -> PyBool
[src]
fn into_py_object(self, _py: Python) -> PyBool
[src]
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
fn to_py_object(&self, py: Python) -> PyBytes
[src]
fn into_py_object(self, _py: Python) -> PyBytes
[src]
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
fn to_py_object(&self, py: Python) -> PyCapsule
[src]
fn into_py_object(self, _py: Python) -> PyCapsule
[src]
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
fn to_py_object(&self, py: Python) -> PyDict
[src]
fn into_py_object(self, _py: Python) -> PyDict
[src]
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
fn to_py_object(&self, py: Python) -> PyFloat
[src]
fn into_py_object(self, _py: Python) -> PyFloat
[src]
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
fn to_py_object(&self, py: Python) -> PyLong
[src]
fn into_py_object(self, _py: Python) -> PyLong
[src]
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
fn to_py_object(&self, py: Python) -> PyList
[src]
fn into_py_object(self, _py: Python) -> PyList
[src]
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
fn to_py_object(&self, py: Python) -> PyModule
[src]
fn into_py_object(self, _py: Python) -> PyModule
[src]
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
fn to_py_object(&self, py: Python) -> PyObject
[src]
fn into_py_object(self, _py: Python) -> PyObject
[src]
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
fn to_py_object(&self, py: Python) -> PySequence
[src]
fn into_py_object(self, _py: Python) -> PySequence
[src]
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
fn to_py_object(&self, py: Python) -> PySet
[src]
fn into_py_object(self, _py: Python) -> PySet
[src]
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
fn to_py_object(&self, py: Python) -> PyTuple
[src]
fn into_py_object(self, _py: Python) -> PyTuple
[src]
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
fn to_py_object(&self, py: Python) -> PyType
[src]
fn into_py_object(self, _py: Python) -> PyType
[src]
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
fn to_py_object(&self, py: Python) -> PyString
[src]
fn into_py_object(self, _py: Python) -> PyString
[src]
fn with_borrowed_ptr<F, R>(&self, _py: Python, f: F) -> R where
F: FnOnce(*mut PyObject) -> R,
[src]
F: FnOnce(*mut PyObject) -> R,