#[repr(transparent)]pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>);Expand description
A Python thread-attached equivalent to Py<T>.
This type can be thought of as equivalent to the tuple (Py<T>, Python<'py>). By having the 'py
lifetime of the Python<'py> token, this ties the lifetime of the Bound<'py, T> smart pointer
to the lifetime the thread is attached to the Python interpreter and allows PyO3 to call Python APIs
at maximum efficiency.
To access the object in situations where the thread is not attached, convert it to Py<T>
using .unbind(). This includes, for example, usage in
Python::detach’s closure.
See the guide for more detail.
Tuple Fields§
§0: Python<'py>§1: ManuallyDrop<Py<T>>Implementations§
Source§impl Bound<'_, PyType>
impl Bound<'_, PyType>
pub(crate) fn get_slot<const S: c_int>(
&self,
slot: Slot<S>,
) -> <Slot<S> as GetSlotImpl>::Typewhere
Slot<S>: GetSlotImpl,
Source§impl<'py, T> Bound<'py, T>where
T: PyClass,
impl<'py, T> Bound<'py, T>where
T: PyClass,
Sourcepub fn new(
py: Python<'py>,
value: impl Into<PyClassInitializer<T>>,
) -> PyResult<Bound<'py, T>>
pub fn new( py: Python<'py>, value: impl Into<PyClassInitializer<T>>, ) -> PyResult<Bound<'py, T>>
Creates a new instance Bound<T> of a #[pyclass] on the Python heap.
§Examples
use pyo3::prelude::*;
#[pyclass]
struct Foo {/* fields omitted */}
let foo: Py<Foo> = Python::attach(|py| -> PyResult<_> {
let foo: Bound<'_, Foo> = Bound::new(py, Foo {})?;
Ok(foo.into())
})?;Source§impl<'py, T> Bound<'py, T>
impl<'py, T> Bound<'py, T>
Sourcepub fn cast<U>(&self) -> Result<&Bound<'py, U>, CastError<'_, 'py>>where
U: PyTypeCheck,
pub fn cast<U>(&self) -> Result<&Bound<'py, U>, CastError<'_, 'py>>where
U: PyTypeCheck,
Cast this to a concrete Python type or pyclass.
Note that you can often avoid casting yourself by just specifying the desired type in function or method signatures. However, manual casting is sometimes necessary.
For extracting a Rust-only type, see extract.
This performs a runtime type check using the equivalent of Python’s
isinstance(self, U).
§Example: Casting to a specific Python object
use pyo3::prelude::*;
use pyo3::types::{PyDict, PyList};
Python::attach(|py| {
let dict = PyDict::new(py);
assert!(dict.is_instance_of::<PyAny>());
let any = dict.as_any();
assert!(any.cast::<PyDict>().is_ok());
assert!(any.cast::<PyList>().is_err());
});§Example: Getting a reference to a pyclass
This is useful if you want to mutate a Py<PyAny> that might actually be a pyclass.
use pyo3::prelude::*;
#[pyclass]
struct Class {
i: i32,
}
Python::attach(|py| {
let class = Bound::new(py, Class { i: 0 })?.into_any();
let class_bound: &Bound<'_, Class> = class.cast()?;
class_bound.borrow_mut().i += 1;
// Alternatively you can get a `PyRefMut` directly
let class_ref: PyRefMut<'_, Class> = class.extract()?;
assert_eq!(class_ref.i, 1);
Ok(())
})Sourcepub fn cast_into<U>(self) -> Result<Bound<'py, U>, CastIntoError<'py>>where
U: PyTypeCheck,
pub fn cast_into<U>(self) -> Result<Bound<'py, U>, CastIntoError<'py>>where
U: PyTypeCheck,
Like cast but takes ownership of self.
In case of an error, it is possible to retrieve self again via
CastIntoError::into_inner.
§Example
use pyo3::prelude::*;
use pyo3::types::{PyDict, PyList};
Python::attach(|py| {
let obj: Bound<'_, PyAny> = PyDict::new(py).into_any();
let obj: Bound<'_, PyAny> = match obj.cast_into::<PyList>() {
Ok(_) => panic!("obj should not be a list"),
Err(err) => err.into_inner(),
};
// obj is a dictionary
assert!(obj.cast_into::<PyDict>().is_ok());
})Sourcepub fn cast_exact<U>(&self) -> Result<&Bound<'py, U>, CastError<'_, 'py>>where
U: PyTypeInfo,
pub fn cast_exact<U>(&self) -> Result<&Bound<'py, U>, CastError<'_, 'py>>where
U: PyTypeInfo,
Cast this to a concrete Python type or pyclass (but not a subclass of it).
It is almost always better to use cast because it accounts for Python
subtyping. Use this method only when you do not want to allow subtypes.
The advantage of this method over cast is that it is faster. The
implementation of cast_exact uses the equivalent of the Python expression type(self) is U, whereas cast uses isinstance(self, U).
For extracting a Rust-only type, see extract.
§Example: Casting to a specific Python object but not a subtype
use pyo3::prelude::*;
use pyo3::types::{PyBool, PyInt};
Python::attach(|py| {
let b = PyBool::new(py, true);
assert!(b.is_instance_of::<PyBool>());
let any: &Bound<'_, PyAny> = b.as_any();
// `bool` is a subtype of `int`, so `cast` will accept a `bool` as an `int`
// but `cast_exact` will not.
assert!(any.cast::<PyInt>().is_ok());
assert!(any.cast_exact::<PyInt>().is_err());
assert!(any.cast_exact::<PyBool>().is_ok());
});Sourcepub fn cast_into_exact<U>(self) -> Result<Bound<'py, U>, CastIntoError<'py>>where
U: PyTypeInfo,
pub fn cast_into_exact<U>(self) -> Result<Bound<'py, U>, CastIntoError<'py>>where
U: PyTypeInfo,
Like cast_exact but takes ownership of self.
Sourcepub unsafe fn cast_unchecked<U>(&self) -> &Bound<'py, U>
pub unsafe fn cast_unchecked<U>(&self) -> &Bound<'py, U>
Converts this to a concrete Python type without checking validity.
§Safety
Callers must ensure that the type is valid or risk type confusion.
Sourcepub unsafe fn cast_into_unchecked<U>(self) -> Bound<'py, U>
pub unsafe fn cast_into_unchecked<U>(self) -> Bound<'py, U>
Like cast_unchecked but takes ownership of self.
§Safety
Callers must ensure that the type is valid or risk type confusion.
Source§impl<'py> Bound<'py, PyAny>
impl<'py> Bound<'py, PyAny>
Sourcepub unsafe fn from_owned_ptr(py: Python<'py>, ptr: *mut PyObject) -> Self
pub unsafe fn from_owned_ptr(py: Python<'py>, ptr: *mut PyObject) -> Self
Sourcepub unsafe fn from_owned_ptr_or_opt(
py: Python<'py>,
ptr: *mut PyObject,
) -> Option<Self>
pub unsafe fn from_owned_ptr_or_opt( py: Python<'py>, ptr: *mut PyObject, ) -> Option<Self>
Constructs a new Bound<'py, PyAny> from a pointer. Returns None if ptr is null.
§Safety
ptrmust be a valid pointer to a Python object, or nullptrmust be an owned Python reference, as theBound<'py, PyAny>will assume ownership
Sourcepub unsafe fn from_owned_ptr_or_err(
py: Python<'py>,
ptr: *mut PyObject,
) -> PyResult<Self>
pub unsafe fn from_owned_ptr_or_err( py: Python<'py>, ptr: *mut PyObject, ) -> PyResult<Self>
Constructs a new Bound<'py, PyAny> from a pointer. Returns an Err by calling PyErr::fetch
if ptr is null.
§Safety
ptrmust be a valid pointer to a Python object, or nullptrmust be an owned Python reference, as theBound<'py, PyAny>will assume ownership
Sourcepub(crate) unsafe fn from_owned_ptr_unchecked(
py: Python<'py>,
ptr: *mut PyObject,
) -> Self
pub(crate) unsafe fn from_owned_ptr_unchecked( py: Python<'py>, ptr: *mut PyObject, ) -> Self
Constructs a new Bound<'py, PyAny> from a pointer without checking for null.
§Safety
ptrmust be a valid pointer to a Python objectptrmust be a strong/owned reference
Sourcepub unsafe fn from_borrowed_ptr(py: Python<'py>, ptr: *mut PyObject) -> Self
pub unsafe fn from_borrowed_ptr(py: Python<'py>, ptr: *mut PyObject) -> Self
Sourcepub unsafe fn from_borrowed_ptr_or_opt(
py: Python<'py>,
ptr: *mut PyObject,
) -> Option<Self>
pub unsafe fn from_borrowed_ptr_or_opt( py: Python<'py>, ptr: *mut PyObject, ) -> Option<Self>
Constructs a new Bound<'py, PyAny> from a pointer by creating a new Python reference.
Returns None if ptr is null.
§Safety
ptrmust be a valid pointer to a Python object, or null
Sourcepub unsafe fn from_borrowed_ptr_or_err(
py: Python<'py>,
ptr: *mut PyObject,
) -> PyResult<Self>
pub unsafe fn from_borrowed_ptr_or_err( py: Python<'py>, ptr: *mut PyObject, ) -> PyResult<Self>
Constructs a new Bound<'py, PyAny> from a pointer by creating a new Python reference.
Returns an Err by calling PyErr::fetch if ptr is null.
§Safety
ptrmust be a valid pointer to a Python object, or null
Source#[doc(hidden)]pub unsafe fn ref_from_ptr<'a>(
_py: Python<'py>,
ptr: &'a *mut PyObject,
) -> &'a Self
#[doc(hidden)]pub unsafe fn ref_from_ptr<'a>(
_py: Python<'py>,
ptr: &'a *mut PyObject,
) -> &'a Self
This slightly strange method is used to obtain &Bound<PyAny> from a pointer in macro code
where we need to constrain the lifetime 'a safely.
Note that 'py is required to outlive 'a implicitly by the nature of the fact that
&'a Bound<'py> means that Bound<'py> exists for at least the lifetime 'a.
§Safety
ptrmust be a valid pointer to a Python object for the lifetime'a. Theptrcan be either a borrowed reference or an owned reference, it does not matter, as this is just&Boundthere will never be any ownership transfer.
Sourcepub(crate) unsafe fn ref_from_ptr_or_opt<'a>(
_py: Python<'py>,
ptr: &'a *mut PyObject,
) -> &'a Option<Self>
pub(crate) unsafe fn ref_from_ptr_or_opt<'a>( _py: Python<'py>, ptr: &'a *mut PyObject, ) -> &'a Option<Self>
Variant of the above which returns None for null pointers.
§Safety
ptrmust be a valid pointer to a Python object for the lifetime `’a, or null.
Source#[doc(hidden)]pub unsafe fn ref_from_non_null<'a>(
_py: Python<'py>,
ptr: &'a NonNull<PyObject>,
) -> &'a Self
#[doc(hidden)]pub unsafe fn ref_from_non_null<'a>(
_py: Python<'py>,
ptr: &'a NonNull<PyObject>,
) -> &'a Self
This slightly strange method is used to obtain &Bound<PyAny> from a NonNull in macro
code where we need to constrain the lifetime 'a safely.
Note that 'py is required to outlive 'a implicitly by the nature of the fact that &'a Bound<'py> means that Bound<'py> exists for at least the lifetime 'a.
§Safety
ptrmust be a valid pointer to a Python object for the lifetime'a. Theptrcan be either a borrowed reference or an owned reference, it does not matter, as this is just&Boundthere will never be any ownership transfer.
Source§impl<'py, T> Bound<'py, T>where
T: PyClass,
impl<'py, T> Bound<'py, T>where
T: PyClass,
Sourcepub fn borrow(&self) -> PyRef<'py, T>
pub fn borrow(&self) -> PyRef<'py, T>
Immutably borrows the value T.
This borrow lasts while the returned PyRef exists.
Multiple immutable borrows can be taken out at the same time.
For frozen classes, the simpler get is available.
§Examples
#[pyclass]
struct Foo {
inner: u8,
}
Python::attach(|py| -> PyResult<()> {
let foo: Bound<'_, Foo> = Bound::new(py, Foo { inner: 73 })?;
let inner: &u8 = &foo.borrow().inner;
assert_eq!(*inner, 73);
Ok(())
})?;§Panics
Panics if the value is currently mutably borrowed. For a non-panicking variant, use
try_borrow.
Sourcepub fn borrow_mut(&self) -> PyRefMut<'py, T>
pub fn borrow_mut(&self) -> PyRefMut<'py, T>
Mutably borrows the value T.
This borrow lasts while the returned PyRefMut exists.
§Examples
#[pyclass]
struct Foo {
inner: u8,
}
Python::attach(|py| -> PyResult<()> {
let foo: Bound<'_, Foo> = Bound::new(py, Foo { inner: 73 })?;
foo.borrow_mut().inner = 35;
assert_eq!(foo.borrow().inner, 35);
Ok(())
})?;§Panics
Panics if the value is currently borrowed. For a non-panicking variant, use
try_borrow_mut.
Sourcepub fn try_borrow(&self) -> Result<PyRef<'py, T>, PyBorrowError>
pub fn try_borrow(&self) -> Result<PyRef<'py, T>, PyBorrowError>
Sourcepub fn try_borrow_mut(&self) -> Result<PyRefMut<'py, T>, PyBorrowMutError>
pub fn try_borrow_mut(&self) -> Result<PyRefMut<'py, T>, PyBorrowMutError>
Attempts to mutably borrow the value T, returning an error if the value is currently borrowed.
The borrow lasts while the returned PyRefMut exists.
This is the non-panicking variant of borrow_mut.
Sourcepub fn get(&self) -> &T
pub fn get(&self) -> &T
Provide an immutable borrow of the value T.
This is available if the class is frozen and Sync.
§Examples
use core::sync::atomic::{AtomicUsize, Ordering};
#[pyclass(frozen)]
struct FrozenCounter {
value: AtomicUsize,
}
Python::attach(|py| {
let counter = FrozenCounter { value: AtomicUsize::new(0) };
let py_counter = Bound::new(py, counter).unwrap();
py_counter.get().value.fetch_add(1, Ordering::Relaxed);
});Sourcepub fn as_super(&self) -> &Bound<'py, T::BaseType>
pub fn as_super(&self) -> &Bound<'py, T::BaseType>
Upcast this Bound<PyClass> to its base type by reference.
If this type defined an explicit base class in its pyclass declaration
(e.g. #[pyclass(extends = BaseType)]), the returned type will be
&Bound<BaseType>. If an explicit base class was not declared, the
return value will be &Bound<PyAny> (making this method equivalent
to as_any).
This method is particularly useful for calling methods defined in an
extension trait that has been implemented for Bound<BaseType>.
See also the into_super method to upcast by value, and the
PyRef::as_super/PyRefMut::as_super methods for upcasting a pyclass
that has already been borrowed.
§Example: Calling a method defined on the Bound base type
use pyo3::prelude::*;
#[pyclass(subclass)]
struct BaseClass;
trait MyClassMethods<'py> {
fn pyrepr(&self) -> PyResult<String>;
}
impl<'py> MyClassMethods<'py> for Bound<'py, BaseClass> {
fn pyrepr(&self) -> PyResult<String> {
self.call_method0("__repr__")?.extract()
}
}
#[pyclass(extends = BaseClass)]
struct SubClass;
Python::attach(|py| {
let initializer = PyClassInitializer::from(BaseClass).add_subclass(SubClass);
let obj = Bound::new(py, initializer).unwrap();
assert!(obj.as_super().pyrepr().is_ok());
})Sourcepub fn into_super(self) -> Bound<'py, T::BaseType>
pub fn into_super(self) -> Bound<'py, T::BaseType>
Upcast this Bound<PyClass> to its base type by value.
If this type defined an explicit base class in its pyclass declaration
(e.g. #[pyclass(extends = BaseType)]), the returned type will be
Bound<BaseType>. If an explicit base class was not declared, the
return value will be Bound<PyAny> (making this method equivalent
to into_any).
This method is particularly useful for calling methods defined in an
extension trait that has been implemented for Bound<BaseType>.
See also the as_super method to upcast by reference, and the
PyRef::into_super/PyRefMut::into_super methods for upcasting a pyclass
that has already been borrowed.
§Example: Calling a method defined on the Bound base type
use pyo3::prelude::*;
#[pyclass(subclass)]
struct BaseClass;
trait MyClassMethods<'py> {
fn pyrepr(self) -> PyResult<String>;
}
impl<'py> MyClassMethods<'py> for Bound<'py, BaseClass> {
fn pyrepr(self) -> PyResult<String> {
self.call_method0("__repr__")?.extract()
}
}
#[pyclass(extends = BaseClass)]
struct SubClass;
Python::attach(|py| {
let initializer = PyClassInitializer::from(BaseClass).add_subclass(SubClass);
let obj = Bound::new(py, initializer).unwrap();
assert!(obj.into_super().pyrepr().is_ok());
})pub(crate) fn get_class_object(&self) -> &<T as PyClassImpl>::Layout
Source§impl<'py, T> Bound<'py, T>
impl<'py, T> Bound<'py, T>
Sourcepub fn as_ptr(&self) -> *mut PyObject
pub fn as_ptr(&self) -> *mut PyObject
Returns the raw FFI pointer represented by self.
§Safety
Callers are responsible for ensuring that the pointer does not outlive self.
The reference is borrowed; callers should not decrease the reference count when they are finished with the pointer.
Sourcepub fn into_ptr(self) -> *mut PyObject
pub fn into_ptr(self) -> *mut PyObject
Returns an owned raw FFI pointer represented by self.
§Safety
The reference is owned; when finished the caller should either transfer ownership
of the pointer or decrease the reference count (e.g. with pyo3::ffi::Py_DecRef).
Sourcepub fn into_any(self) -> Bound<'py, PyAny>
pub fn into_any(self) -> Bound<'py, PyAny>
Helper to cast to Bound<'py, PyAny>, transferring ownership.
Sourcepub fn as_borrowed<'a>(&'a self) -> Borrowed<'a, 'py, T>
pub fn as_borrowed<'a>(&'a self) -> Borrowed<'a, 'py, T>
Casts this Bound<T> to a Borrowed<T> smart pointer.
Sourcepub fn unbind(self) -> Py<T>
pub fn unbind(self) -> Py<T>
Removes the connection for this Bound<T> from the Python<'py> token,
allowing it to cross thread boundaries.
Sourcepub fn as_unbound(&self) -> &Py<T>
pub fn as_unbound(&self) -> &Py<T>
Removes the connection for this Bound<T> from the Python<'py> token,
allowing it to cross thread boundaries, without transferring ownership.
Source§impl<'py> Bound<'py, PyAny>
impl<'py> Bound<'py, PyAny>
Sourcepub(crate) fn lookup_special<N>(
&self,
attr_name: N,
) -> PyResult<Option<Bound<'py, PyAny>>>where
N: IntoPyObject<'py, Target = PyString>,
pub(crate) fn lookup_special<N>(
&self,
attr_name: N,
) -> PyResult<Option<Bound<'py, PyAny>>>where
N: IntoPyObject<'py, Target = PyString>,
Retrieve an attribute value, skipping the instance dictionary during the lookup but still binding the object to the instance.
This is useful when trying to resolve Python’s “magic” methods like __getitem__, which
are looked up starting from the type object. This returns an Option as it is not
typically a direct error for the special lookup to fail, as magic methods are optional in
many situations in which they might be called.
To avoid repeated temporary allocations of Python strings, the intern! macro can be used
to intern attr_name.
pub(crate) fn _get_refcnt(&self) -> isize
Source§impl<'py> Bound<'py, PyIterator>
impl<'py> Bound<'py, PyIterator>
Sourcepub fn send(&self, value: &Bound<'py, PyAny>) -> PyResult<PySendResult<'py>>
Available on Py_3_10 and non-PyPy only.
pub fn send(&self, value: &Bound<'py, PyAny>) -> PyResult<PySendResult<'py>>
Py_3_10 and non-PyPy only.Sends a value into a python generator. This is the equivalent of calling
generator.send(value) in Python. This resumes the generator and continues its execution
until the next yield or return statement. When the generator completes, the (optional)
return value will be returned as PySendResult::Return. All subsequent calls will return
PySendResult::Return(None). The first call to send must be made with None as the
argument to start the generator, failing to do so will raise a TypeError.
Trait Implementations§
Source§impl<'py> Add for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Add for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Add for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Add for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Add<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Add<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Add<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Add<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py, T> BoundObject<'py, T> for Bound<'py, T>
impl<'py, T> BoundObject<'py, T> for Bound<'py, T>
Source§fn as_borrowed(&self) -> Borrowed<'_, 'py, T>
fn as_borrowed(&self) -> Borrowed<'_, 'py, T>
Source§fn into_bound(self) -> Bound<'py, T>
fn into_bound(self) -> Bound<'py, T>
Bound<'py, T>Source§impl<'py, T> Deref for Bound<'py, T>where
T: DerefToPyAny,
impl<'py, T> Deref for Bound<'py, T>where
T: DerefToPyAny,
Source§impl<'py> Div for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Div for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Div for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Div for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Div<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Div<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Div<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Div<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl From<Bound<'_, PyByteArray>> for PyBackedBytes
impl From<Bound<'_, PyByteArray>> for PyBackedBytes
Source§fn from(py_bytearray: Bound<'_, PyByteArray>) -> Self
fn from(py_bytearray: Bound<'_, PyByteArray>) -> Self
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for Bound<'py, T>where
T: PyTypeCheck + 'a,
impl<'a, 'py, T> FromPyObject<'a, 'py> for Bound<'py, T>where
T: PyTypeCheck + 'a,
Source§fn extract(ob: Borrowed<'a, 'py, PyAny>) -> Result<Self, Self::Error>
fn extract(ob: Borrowed<'a, 'py, PyAny>) -> Result<Self, Self::Error>
Extracts Self from the source PyObject.
Source§const INPUT_TYPE: PyStaticExpr = T::TYPE_HINT
const INPUT_TYPE: PyStaticExpr = T::TYPE_HINT
experimental-inspect only.Source§type Error = CastError<'a, 'py>
type Error = CastError<'a, 'py>
Source§#[doc(hidden)]fn sequence_extractor(
_obj: Borrowed<'_, 'py, PyAny>,
_: Token,
) -> Option<impl FromPyObjectSequence<Target = Self>>
#[doc(hidden)]fn sequence_extractor(
_obj: Borrowed<'_, 'py, PyAny>,
_: Token,
) -> Option<impl FromPyObjectSequence<Target = Self>>
Vec<u8> and [u8; N],
where the bytes can be directly copied from some python objects without going through
iteration.Source§fn as_local_tz(_: Token) -> Option<Self>
fn as_local_tz(_: Token) -> Option<Self>
chrono-local only.DateTime<Tz> where Tz is
chrono::Local, which will accept “naive” datetime objects as being in the local timezone.Source§impl<I: SliceIndex<[u8]>> Index<I> for Bound<'_, PyBytes>
This is the same way Vec is indexed.
impl<I: SliceIndex<[u8]>> Index<I> for Bound<'_, PyBytes>
This is the same way Vec is indexed.
Source§impl<'py> IntoIterator for Bound<'py, PyDict>
impl<'py> IntoIterator for Bound<'py, PyDict>
Source§impl<'py> IntoIterator for &Bound<'py, PyDict>
impl<'py> IntoIterator for &Bound<'py, PyDict>
Source§impl<'py> IntoIterator for Bound<'py, PyFrozenSet>
impl<'py> IntoIterator for Bound<'py, PyFrozenSet>
Source§impl<'py> IntoIterator for &Bound<'py, PyFrozenSet>
impl<'py> IntoIterator for &Bound<'py, PyFrozenSet>
Source§impl<'py> IntoIterator for &Bound<'py, PyIterator>
impl<'py> IntoIterator for &Bound<'py, PyIterator>
Source§impl<'py> IntoIterator for Bound<'py, PyList>
impl<'py> IntoIterator for Bound<'py, PyList>
Source§impl<'py> IntoIterator for &Bound<'py, PyList>
impl<'py> IntoIterator for &Bound<'py, PyList>
Source§impl<'py> IntoIterator for Bound<'py, PySet>
impl<'py> IntoIterator for Bound<'py, PySet>
Source§impl<'py> IntoIterator for &Bound<'py, PySet>
impl<'py> IntoIterator for &Bound<'py, PySet>
Source§impl<'py> IntoIterator for Bound<'py, PyTuple>
impl<'py> IntoIterator for Bound<'py, PyTuple>
Source§impl<'py> IntoIterator for &Bound<'py, PyTuple>
impl<'py> IntoIterator for &Bound<'py, PyTuple>
Source§impl<'py, T: PyTypeCheck> IntoPyObject<'py> for Bound<'py, T>
impl<'py, T: PyTypeCheck> IntoPyObject<'py> for Bound<'py, T>
Source§const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT
const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT
experimental-inspect only.Source§type Output = Bound<'py, <Bound<'py, T> as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Bound<'py, T> as IntoPyObject<'py>>::Target>
Source§type Error = Infallible
type Error = Infallible
Source§fn into_pyobject(self, _py: Python<'py>) -> Result<Self::Output, Self::Error>
fn into_pyobject(self, _py: Python<'py>) -> Result<Self::Output, Self::Error>
Source§#[doc(hidden)]fn owned_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>
#[doc(hidden)]fn owned_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>
Vec<u8>, [u8; N]
and SmallVec<[u8; N]> as a sequence of bytes into a bytes object.Source§#[doc(hidden)]const SEQUENCE_OUTPUT_TYPE: PyStaticExpr = _
#[doc(hidden)]const SEQUENCE_OUTPUT_TYPE: PyStaticExpr = _
experimental-inspect only.IntoPyObject::owned_sequence_into_pyobject and IntoPyObject::borrowed_sequence_into_pyobjectSource§impl<'a, 'py, T: PyTypeCheck> IntoPyObject<'py> for &'a Bound<'py, T>
impl<'a, 'py, T: PyTypeCheck> IntoPyObject<'py> for &'a Bound<'py, T>
Source§const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT
const OUTPUT_TYPE: PyStaticExpr = T::TYPE_HINT
experimental-inspect only.Source§type Output = Borrowed<'a, 'py, <&'a Bound<'py, T> as IntoPyObject<'py>>::Target>
type Output = Borrowed<'a, 'py, <&'a Bound<'py, T> as IntoPyObject<'py>>::Target>
Source§type Error = Infallible
type Error = Infallible
Source§fn into_pyobject(self, _py: Python<'py>) -> Result<Self::Output, Self::Error>
fn into_pyobject(self, _py: Python<'py>) -> Result<Self::Output, Self::Error>
Source§#[doc(hidden)]fn owned_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>
#[doc(hidden)]fn owned_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>
Vec<u8>, [u8; N]
and SmallVec<[u8; N]> as a sequence of bytes into a bytes object.Source§#[doc(hidden)]fn borrowed_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>where
Self: Reference,
I: IntoIterator<Item = Self> + AsRef<[<Self as Reference>::BaseType]>,
I::IntoIter: ExactSizeIterator<Item = Self>,
#[doc(hidden)]fn borrowed_sequence_into_pyobject<I>(
iter: I,
py: Python<'py>,
_: Token,
) -> Result<Bound<'py, PyAny>, PyErr>where
Self: Reference,
I: IntoIterator<Item = Self> + AsRef<[<Self as Reference>::BaseType]>,
I::IntoIter: ExactSizeIterator<Item = Self>,
&[u8] and Cow<[u8]>
as a sequence of bytes into a bytes object.Source§#[doc(hidden)]const SEQUENCE_OUTPUT_TYPE: PyStaticExpr = _
#[doc(hidden)]const SEQUENCE_OUTPUT_TYPE: PyStaticExpr = _
experimental-inspect only.IntoPyObject::owned_sequence_into_pyobject and IntoPyObject::borrowed_sequence_into_pyobjectSource§impl<'py> Iterator for Bound<'py, PyIterator>
impl<'py> Iterator for Bound<'py, PyIterator>
Source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Retrieves the next item from an iterator.
Returns None when the iterator is exhausted.
If an exception occurs, returns Some(Err(..)).
Further next() calls after an exception occurs are likely
to repeatedly result in the same exception.
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
iter_next_chunk)N values. Read more1.0.0 (const: unstable) · Source§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
1.0.0 (const: unstable) · Source§fn last(self) -> Option<Self::Item>where
Self: Sized,
fn last(self) -> Option<Self::Item>where
Self: Sized,
Source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by)n elements. Read more1.0.0 (const: unstable) · Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
nth element of the iterator. Read more1.28.0 (const: unstable) · Source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
1.0.0 (const: unstable) · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 (const: unstable) · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse)separator between items
of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse)separator
between items of the original iterator. Read more1.0.0 (const: unstable) · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.21.0 (const: unstable) · Source§fn for_each<F>(self, f: F)
fn for_each<F>(self, f: F)
1.0.0 (const: unstable) · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 (const: unstable) · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 (const: unstable) · Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
1.0.0 (const: unstable) · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 (const: unstable) · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 (const: unstable) · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 (const: unstable) · Source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n elements. Read more1.0.0 (const: unstable) · Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n elements, or fewer
if the underlying iterator ends sooner. Read more1.0.0 (const: unstable) · Source§fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
1.0.0 (const: unstable) · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 (const: unstable) · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows)f for each contiguous window of size N over
self and returns an iterator over the outputs of f. Like slice::windows(),
the windows during mapping overlap as well. Read more1.0.0 (const: unstable) · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 (const: unstable) · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Iterator. Read more1.0.0 (const: unstable) · Source§fn collect<B>(self) -> B
fn collect<B>(self) -> B
Source§fn try_collect<B>(
&mut self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( &mut self, ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into)1.0.0 (const: unstable) · Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned)true precede all those that return false. Read more1.27.0 (const: unstable) · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 (const: unstable) · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 (const: unstable) · Source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 (const: unstable) · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
&mut self,
f: impl FnMut(Self::Item, Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( &mut self, f: impl FnMut(Self::Item, Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce)1.0.0 (const: unstable) · Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 (const: unstable) · Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 (const: unstable) · Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 (const: unstable) · Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn try_find<R>(
&mut self,
f: impl FnMut(&Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( &mut self, f: impl FnMut(&Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find)1.0.0 (const: unstable) · Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 (const: unstable) · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 (const: unstable) · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 (const: unstable) · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 (const: unstable) · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 (const: unstable) · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 (const: unstable) · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 (const: unstable) · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 (const: unstable) · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
1.0.0 (const: unstable) · Source§fn cycle(self) -> Cycle<Self>
fn cycle(self) -> Cycle<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
iter_array_chunks)N elements of the iterator at a time. Read more1.11.0 (const: unstable) · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read more1.5.0 (const: unstable) · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
PartialOrd elements of
this Iterator with those of another. The comparison works like short-circuit
evaluation, returning a result without comparing the remaining elements.
As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read moreSource§fn eq_by<I, F>(self, other: I, eq: F) -> bool
fn eq_by<I, F>(self, other: I, eq: F) -> bool
iter_order_by)1.5.0 (const: unstable) · Source§fn lt<I>(self, other: I) -> bool
fn lt<I>(self, other: I) -> bool
Iterator are lexicographically
less than those of another. Read more1.5.0 (const: unstable) · Source§fn le<I>(self, other: I) -> bool
fn le<I>(self, other: I) -> bool
Iterator are lexicographically
less or equal to those of another. Read more1.5.0 (const: unstable) · Source§fn gt<I>(self, other: I) -> bool
fn gt<I>(self, other: I) -> bool
Iterator are lexicographically
greater than those of another. Read more1.5.0 (const: unstable) · Source§fn ge<I>(self, other: I) -> bool
fn ge<I>(self, other: I) -> bool
Iterator are lexicographically
greater than or equal to those of another. Read more1.82.0 (const: unstable) · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 (const: unstable) · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
Source§impl<'py> Mul for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Mul for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Mul for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Mul for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Mul<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Mul<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Mul<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Mul<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Neg for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Neg for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Neg for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Neg for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl PartialEq<&Bound<'_, PyBool>> for bool
Compare bool with &Bound<PyBool>
impl PartialEq<&Bound<'_, PyBool>> for bool
Compare bool with &Bound<PyBool>
Source§impl PartialEq<&Bound<'_, PyBytes>> for [u8]
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<&Bound<'_, PyBytes>> for [u8]
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<&Bound<'_, PyFloat>> for f64
impl PartialEq<&Bound<'_, PyFloat>> for f64
Source§impl PartialEq<&Bound<'_, PyFloat>> for f32
impl PartialEq<&Bound<'_, PyFloat>> for f32
Source§impl PartialEq<&Bound<'_, PyString>> for str
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<&Bound<'_, PyString>> for str
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl PartialEq<&[u8]> for Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<&[u8]> for Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<&str> for Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<&str> for Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl PartialEq<Bound<'_, PyBool>> for bool
Compare bool with Bound<PyBool>
impl PartialEq<Bound<'_, PyBool>> for bool
Compare bool with Bound<PyBool>
Source§impl PartialEq<Bound<'_, PyBool>> for &bool
Compare &bool with Bound<PyBool>
impl PartialEq<Bound<'_, PyBool>> for &bool
Compare &bool with Bound<PyBool>
Source§impl PartialEq<Bound<'_, PyBytes>> for [u8]
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<Bound<'_, PyBytes>> for [u8]
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<Bound<'_, PyBytes>> for &[u8]
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<Bound<'_, PyBytes>> for &[u8]
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<Bound<'_, PyFloat>> for f64
impl PartialEq<Bound<'_, PyFloat>> for f64
Source§impl PartialEq<Bound<'_, PyFloat>> for &f64
impl PartialEq<Bound<'_, PyFloat>> for &f64
Source§impl PartialEq<Bound<'_, PyFloat>> for f32
impl PartialEq<Bound<'_, PyFloat>> for f32
Source§impl PartialEq<Bound<'_, PyFloat>> for &f32
impl PartialEq<Bound<'_, PyFloat>> for &f32
Source§impl PartialEq<Bound<'_, PyInt>> for i8
impl PartialEq<Bound<'_, PyInt>> for i8
Source§impl PartialEq<Bound<'_, PyInt>> for u8
impl PartialEq<Bound<'_, PyInt>> for u8
Source§impl PartialEq<Bound<'_, PyInt>> for i16
impl PartialEq<Bound<'_, PyInt>> for i16
Source§impl PartialEq<Bound<'_, PyInt>> for u16
impl PartialEq<Bound<'_, PyInt>> for u16
Source§impl PartialEq<Bound<'_, PyInt>> for i32
impl PartialEq<Bound<'_, PyInt>> for i32
Source§impl PartialEq<Bound<'_, PyInt>> for u32
impl PartialEq<Bound<'_, PyInt>> for u32
Source§impl PartialEq<Bound<'_, PyInt>> for i64
impl PartialEq<Bound<'_, PyInt>> for i64
Source§impl PartialEq<Bound<'_, PyInt>> for u64
impl PartialEq<Bound<'_, PyInt>> for u64
Source§impl PartialEq<Bound<'_, PyInt>> for i128
impl PartialEq<Bound<'_, PyInt>> for i128
Source§impl PartialEq<Bound<'_, PyInt>> for u128
impl PartialEq<Bound<'_, PyInt>> for u128
Source§impl PartialEq<Bound<'_, PyInt>> for isize
impl PartialEq<Bound<'_, PyInt>> for isize
Source§impl PartialEq<Bound<'_, PyInt>> for usize
impl PartialEq<Bound<'_, PyInt>> for usize
Source§impl PartialEq<Bound<'_, PyString>> for str
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<Bound<'_, PyString>> for str
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl PartialEq<Bound<'_, PyString>> for &str
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<Bound<'_, PyString>> for &str
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl PartialEq<[u8]> for Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<[u8]> for Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<[u8]> for &Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
impl PartialEq<[u8]> for &Bound<'_, PyBytes>
Compares whether the Python bytes object is equal to the u8.
In some cases Python equality might be more appropriate; see the note on PyBytes.
Source§impl PartialEq<str> for Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<str> for Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl PartialEq<str> for &Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
impl PartialEq<str> for &Bound<'_, PyString>
Compares whether the data in the Python string is equal to the given UTF8.
In some cases Python equality might be more appropriate; see the note on PyString.
Source§impl<'py> PyAnyMethods<'py> for Bound<'py, PyAny>
impl<'py> PyAnyMethods<'py> for Bound<'py, PyAny>
Source§fn add<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn add<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self + other.
Source§fn sub<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn sub<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self - other.
Source§fn mul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn mul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self * other.
Source§fn matmul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn matmul<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self @ other.
Source§fn div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self / other.
Source§fn floor_div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn floor_div<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self // other.
Source§fn rem<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn rem<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self % other.
Source§fn lshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn lshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self << other.
Source§fn rshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn rshift<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self >> other.
Source§fn bitand<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn bitand<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self & other.
Source§fn bitor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn bitor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self | other.
Source§fn bitxor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn bitxor<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes self ^ other.
Source§fn divmod<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn divmod<O>(&self, other: O) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Computes divmod(self, other).
Source§fn pow<O1, O2>(&self, other: O1, modulus: O2) -> PyResult<Bound<'py, PyAny>>where
O1: IntoPyObject<'py>,
O2: IntoPyObject<'py>,
fn pow<O1, O2>(&self, other: O1, modulus: O2) -> PyResult<Bound<'py, PyAny>>where
O1: IntoPyObject<'py>,
O2: IntoPyObject<'py>,
Computes self ** other % modulus (pow(self, other, modulus)).
py.None() may be passed for the modulus.
Source§fn hasattr<N>(&self, attr_name: N) -> PyResult<bool>where
N: IntoPyObject<'py, Target = PyString>,
fn hasattr<N>(&self, attr_name: N) -> PyResult<bool>where
N: IntoPyObject<'py, Target = PyString>,
Source§fn getattr<N>(&self, attr_name: N) -> PyResult<Bound<'py, PyAny>>where
N: IntoPyObject<'py, Target = PyString>,
fn getattr<N>(&self, attr_name: N) -> PyResult<Bound<'py, PyAny>>where
N: IntoPyObject<'py, Target = PyString>,
Source§fn getattr_opt<N>(&self, attr_name: N) -> PyResult<Option<Bound<'py, PyAny>>>where
N: IntoPyObject<'py, Target = PyString>,
fn getattr_opt<N>(&self, attr_name: N) -> PyResult<Option<Bound<'py, PyAny>>>where
N: IntoPyObject<'py, Target = PyString>,
Source§fn setattr<N, V>(&self, attr_name: N, value: V) -> PyResult<()>
fn setattr<N, V>(&self, attr_name: N, value: V) -> PyResult<()>
Source§fn delattr<N>(&self, attr_name: N) -> PyResult<()>where
N: IntoPyObject<'py, Target = PyString>,
fn delattr<N>(&self, attr_name: N) -> PyResult<()>where
N: IntoPyObject<'py, Target = PyString>,
Source§fn rich_compare<O>(
&self,
other: O,
compare_op: CompareOp,
) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
fn rich_compare<O>(
&self,
other: O,
compare_op: CompareOp,
) -> PyResult<Bound<'py, PyAny>>where
O: IntoPyObject<'py>,
Source§fn lt<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn lt<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn le<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn le<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn eq<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn eq<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn ne<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn ne<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn gt<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn gt<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn ge<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
fn ge<O>(&self, other: O) -> PyResult<bool>where
O: IntoPyObject<'py>,
Source§fn is_callable(&self) -> bool
fn is_callable(&self) -> bool
Source§fn call<A>(
&self,
args: A,
kwargs: Option<&Bound<'py, PyDict>>,
) -> PyResult<Bound<'py, PyAny>>where
A: PyCallArgs<'py>,
fn call<A>(
&self,
args: A,
kwargs: Option<&Bound<'py, PyDict>>,
) -> PyResult<Bound<'py, PyAny>>where
A: PyCallArgs<'py>,
Source§fn call1<A>(&self, args: A) -> PyResult<Bound<'py, PyAny>>where
A: PyCallArgs<'py>,
fn call1<A>(&self, args: A) -> PyResult<Bound<'py, PyAny>>where
A: PyCallArgs<'py>,
Source§fn call_method<N, A>(
&self,
name: N,
args: A,
kwargs: Option<&Bound<'py, PyDict>>,
) -> PyResult<Bound<'py, PyAny>>
fn call_method<N, A>( &self, name: N, args: A, kwargs: Option<&Bound<'py, PyDict>>, ) -> PyResult<Bound<'py, PyAny>>
Source§fn call_method0<N>(&self, name: N) -> PyResult<Bound<'py, PyAny>>where
N: IntoPyObject<'py, Target = PyString>,
fn call_method0<N>(&self, name: N) -> PyResult<Bound<'py, PyAny>>where
N: IntoPyObject<'py, Target = PyString>,
Source§fn call_method1<N, A>(&self, name: N, args: A) -> PyResult<Bound<'py, PyAny>>
fn call_method1<N, A>(&self, name: N, args: A) -> PyResult<Bound<'py, PyAny>>
Source§fn is_truthy(&self) -> PyResult<bool>
fn is_truthy(&self) -> PyResult<bool>
Source§fn is_empty(&self) -> PyResult<bool>
fn is_empty(&self) -> PyResult<bool>
Source§fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>where
K: IntoPyObject<'py>,
fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>where
K: IntoPyObject<'py>,
Source§fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
Source§fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
Source§fn try_iter(&self) -> PyResult<Bound<'py, PyIterator>>
fn try_iter(&self) -> PyResult<Bound<'py, PyIterator>>
Source§fn get_type(&self) -> Bound<'py, PyType>
fn get_type(&self) -> Bound<'py, PyType>
Source§fn get_type_ptr(&self) -> *mut PyTypeObject
fn get_type_ptr(&self) -> *mut PyTypeObject
Source§fn extract<'a, T>(&'a self) -> Result<T, T::Error>where
T: FromPyObject<'a, 'py>,
fn extract<'a, T>(&'a self) -> Result<T, T::Error>where
T: FromPyObject<'a, 'py>,
Source§fn get_refcnt(&self) -> isize
fn get_refcnt(&self) -> isize
use pyo3::ffi::Py_REFCNT(obj.as_ptr()) instead
Source§fn repr(&self) -> PyResult<Bound<'py, PyString>>
fn repr(&self) -> PyResult<Bound<'py, PyString>>
Source§fn str(&self) -> PyResult<Bound<'py, PyString>>
fn str(&self) -> PyResult<Bound<'py, PyString>>
Source§fn dir(&self) -> PyResult<Bound<'py, PyList>>
fn dir(&self) -> PyResult<Bound<'py, PyList>>
Source§fn is_instance(&self, ty: &Bound<'py, PyAny>) -> PyResult<bool>
fn is_instance(&self, ty: &Bound<'py, PyAny>) -> PyResult<bool>
ty. Read moreSource§fn is_exact_instance(&self, ty: &Bound<'py, PyAny>) -> bool
fn is_exact_instance(&self, ty: &Bound<'py, PyAny>) -> bool
ty (not a subclass). Read moreSource§fn is_instance_of<T: PyTypeCheck>(&self) -> bool
fn is_instance_of<T: PyTypeCheck>(&self) -> bool
T. Read moreSource§fn is_exact_instance_of<T: PyTypeInfo>(&self) -> bool
fn is_exact_instance_of<T: PyTypeInfo>(&self) -> bool
T. Read moreSource§impl<'py> PyBoolMethods<'py> for Bound<'py, PyBool>
impl<'py> PyBoolMethods<'py> for Bound<'py, PyBool>
Source§impl<'py> PyByteArrayMethods<'py> for Bound<'py, PyByteArray>
impl<'py> PyByteArrayMethods<'py> for Bound<'py, PyByteArray>
Source§fn data(&self) -> *mut u8
fn data(&self) -> *mut u8
Source§unsafe fn as_bytes(&self) -> &[u8] ⓘ
unsafe fn as_bytes(&self) -> &[u8] ⓘ
ByteArray’s entire buffer. Read moreSource§unsafe fn as_bytes_mut(&self) -> &mut [u8] ⓘ
unsafe fn as_bytes_mut(&self) -> &mut [u8] ⓘ
ByteArray’s entire buffer. Read moreSource§impl<'py> PyBytesMethods<'py> for Bound<'py, PyBytes>
impl<'py> PyBytesMethods<'py> for Bound<'py, PyBytes>
Source§impl<'py> PyCallArgs<'py> for Bound<'py, PyTuple>
impl<'py> PyCallArgs<'py> for Bound<'py, PyTuple>
fn call( self, function: Borrowed<'_, 'py, PyAny>, kwargs: Borrowed<'_, 'py, PyDict>, token: Token, ) -> PyResult<Bound<'py, PyAny>>
fn call_positional( self, function: Borrowed<'_, 'py, PyAny>, token: Token, ) -> PyResult<Bound<'py, PyAny>>
#[doc(hidden)]fn call_method_positional(
self,
object: Borrowed<'_, 'py, PyAny>,
method_name: Borrowed<'_, 'py, PyString>,
_: Token,
) -> PyResult<Bound<'py, PyAny>>
Source§impl<'py> PyCallArgs<'py> for &Bound<'py, PyTuple>
impl<'py> PyCallArgs<'py> for &Bound<'py, PyTuple>
fn call( self, function: Borrowed<'_, 'py, PyAny>, kwargs: Borrowed<'_, 'py, PyDict>, token: Token, ) -> PyResult<Bound<'py, PyAny>>
fn call_positional( self, function: Borrowed<'_, 'py, PyAny>, token: Token, ) -> PyResult<Bound<'py, PyAny>>
#[doc(hidden)]fn call_method_positional(
self,
object: Borrowed<'_, 'py, PyAny>,
method_name: Borrowed<'_, 'py, PyString>,
_: Token,
) -> PyResult<Bound<'py, PyAny>>
Source§impl<'py> PyCapsuleMethods<'py> for Bound<'py, PyCapsule>
impl<'py> PyCapsuleMethods<'py> for Bound<'py, PyCapsule>
Source§fn set_context(&self, context: *mut c_void) -> PyResult<()>
fn set_context(&self, context: *mut c_void) -> PyResult<()>
Source§fn context(&self) -> PyResult<*mut c_void>
fn context(&self) -> PyResult<*mut c_void>
Source§fn pointer_checked(&self, name: Option<&CStr>) -> PyResult<NonNull<c_void>>
fn pointer_checked(&self, name: Option<&CStr>) -> PyResult<NonNull<c_void>>
Source§impl<'py> PyCodeMethods<'py> for Bound<'py, PyCode>
impl<'py> PyCodeMethods<'py> for Bound<'py, PyCode>
Source§impl<'py> PyComplexMethods<'py> for Bound<'py, PyComplex>
impl<'py> PyComplexMethods<'py> for Bound<'py, PyComplex>
Source§impl PyDateAccess for Bound<'_, PyDate>
Available on non-Py_LIMITED_API only.
impl PyDateAccess for Bound<'_, PyDate>
Py_LIMITED_API only.Source§impl PyDateAccess for Bound<'_, PyDateTime>
Available on non-Py_LIMITED_API only.
impl PyDateAccess for Bound<'_, PyDateTime>
Py_LIMITED_API only.Source§impl PyDeltaAccess for Bound<'_, PyDelta>
Available on non-Py_LIMITED_API only.
impl PyDeltaAccess for Bound<'_, PyDelta>
Py_LIMITED_API only.Source§fn get_days(&self) -> i32
fn get_days(&self) -> i32
Source§fn get_seconds(&self) -> i32
fn get_seconds(&self) -> i32
Source§fn get_microseconds(&self) -> i32
fn get_microseconds(&self) -> i32
Source§impl<'py> PyDictMethods<'py> for Bound<'py, PyDict>
impl<'py> PyDictMethods<'py> for Bound<'py, PyDict>
Source§fn copy(&self) -> PyResult<Bound<'py, PyDict>>
fn copy(&self) -> PyResult<Bound<'py, PyDict>>
Source§fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
Source§fn get_item<K>(&self, key: K) -> PyResult<Option<Bound<'py, PyAny>>>where
K: IntoPyObject<'py>,
fn get_item<K>(&self, key: K) -> PyResult<Option<Bound<'py, PyAny>>>where
K: IntoPyObject<'py>,
Source§fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
Source§fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
Source§fn iter(&self) -> BoundDictIterator<'py> ⓘ
fn iter(&self) -> BoundDictIterator<'py> ⓘ
(key, value) pairs in this dictionary. Read moreSource§fn locked_for_each<F>(&self, f: F) -> PyResult<()>
fn locked_for_each<F>(&self, f: F) -> PyResult<()>
Source§fn as_mapping(&self) -> &Bound<'py, PyMapping>
fn as_mapping(&self) -> &Bound<'py, PyMapping>
self cast as a PyMapping.Source§fn into_mapping(self) -> Bound<'py, PyMapping>
fn into_mapping(self) -> Bound<'py, PyMapping>
self cast as a PyMapping.Source§fn update(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>
fn update(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>
Source§fn update_if_missing(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>
fn update_if_missing(&self, other: &Bound<'_, PyMapping>) -> PyResult<()>
Source§fn set_default<K, V>(&self, key: K, default_value: V) -> PyResult<bool>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
fn set_default<K, V>(&self, key: K, default_value: V) -> PyResult<bool>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
default_value into this dictionary with a key of key if the key is not already present in the
dictionary. If the key was inserted, returns Ok(true), otherwise returns Ok(false), indicating the key was
already present. If an error happens, returns PyErr. This function uses
PyDict_SetDefaultRef internally.Source§fn set_default_with_result<K, V>(
&self,
key: K,
default_value: V,
) -> PyResult<(bool, Bound<'py, PyAny>)>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
fn set_default_with_result<K, V>(
&self,
key: K,
default_value: V,
) -> PyResult<(bool, Bound<'py, PyAny>)>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
default_value into this dictionary with a key of key if the key is not already present in the
dictionary. If the key was inserted, returns Ok((true, result)), otherwise returns Ok((false, result)) where
result is the value associated with key after this function finishes. If an error happens, returns
PyErr. This function uses
PyDict_SetDefaultRef internally.Source§impl<'py> PyFloatMethods<'py> for Bound<'py, PyFloat>
impl<'py> PyFloatMethods<'py> for Bound<'py, PyFloat>
Source§impl<'py> PyFrameMethods<'py> for Bound<'py, PyFrame>
Available on non-GraalPy and non-Py_LIMITED_API and non-PyPy only.
impl<'py> PyFrameMethods<'py> for Bound<'py, PyFrame>
GraalPy and non-Py_LIMITED_API and non-PyPy only.Source§fn line_number(&self) -> i32
fn line_number(&self) -> i32
Source§fn outer(&self) -> Option<Bound<'py, PyFrame>>
fn outer(&self) -> Option<Bound<'py, PyFrame>>
Py_3_9 only.Source§fn code(&self) -> Bound<'py, PyCode>
fn code(&self) -> Bound<'py, PyCode>
Py_3_10, or Py_3_9 and non-Py_LIMITED_API only.Source§fn var(&self, name: &CStr) -> PyResult<Bound<'py, PyAny>>
fn var(&self, name: &CStr) -> PyResult<Bound<'py, PyAny>>
Py_3_12 only.name of this frame.Source§fn builtins(&self) -> Bound<'py, PyDict>
fn builtins(&self) -> Bound<'py, PyDict>
Py_3_11 only.f_builtins attributeSource§impl<'py> PyFrozenSetMethods<'py> for Bound<'py, PyFrozenSet>
impl<'py> PyFrozenSetMethods<'py> for Bound<'py, PyFrozenSet>
Source§impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder Bound<'py, T>where
T: PyTypeCheck + 'a + 'py,
impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder Bound<'py, T>where
T: PyTypeCheck + 'a + 'py,
Source§const INPUT_TYPE: PyStaticExpr = T::TYPE_HINT
const INPUT_TYPE: PyStaticExpr = T::TYPE_HINT
experimental-inspect only.type Holder = Option<Borrowed<'a, 'py, T>>
type Error = CastError<'a, 'py>
fn extract( obj: Borrowed<'a, 'py, PyAny>, holder: &'holder mut Self::Holder, ) -> Result<Self, Self::Error>
Source§impl<'py> PyListMethods<'py> for Bound<'py, PyList>
impl<'py> PyListMethods<'py> for Bound<'py, PyList>
Source§fn as_sequence(&self) -> &Bound<'py, PySequence>
fn as_sequence(&self) -> &Bound<'py, PySequence>
Returns self cast as a PySequence.
Source§fn into_sequence(self) -> Bound<'py, PySequence>
fn into_sequence(self) -> Bound<'py, PySequence>
Returns self cast as a PySequence.
Source§fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
Gets the list item at the specified index.
§Example
use pyo3::{prelude::*, types::PyList};
Python::attach(|py| {
let list = PyList::new(py, [2, 3, 5, 7]).unwrap();
let obj = list.get_item(0);
assert_eq!(obj.unwrap().extract::<i32>().unwrap(), 2);
});Source§fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyList>
fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyList>
Takes the slice self[low:high] and returns it as a new list.
Indices must be nonnegative, and out-of-range indices are clipped to
self.len().
Source§fn set_item<I>(&self, index: usize, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
fn set_item<I>(&self, index: usize, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
Sets the item at the specified index.
Raises IndexError if the index is out of range.
Source§fn del_item(&self, index: usize) -> PyResult<()>
fn del_item(&self, index: usize) -> PyResult<()>
Deletes the indexth element of self.
This is equivalent to the Python statement del self[i].
Source§fn set_slice(
&self,
low: usize,
high: usize,
seq: &Bound<'_, PyAny>,
) -> PyResult<()>
fn set_slice( &self, low: usize, high: usize, seq: &Bound<'_, PyAny>, ) -> PyResult<()>
Assigns the sequence seq to the slice of self from low to high.
This is equivalent to the Python statement self[low:high] = v.
Source§fn del_slice(&self, low: usize, high: usize) -> PyResult<()>
fn del_slice(&self, low: usize, high: usize) -> PyResult<()>
Deletes the slice from low to high from self.
This is equivalent to the Python statement del self[low:high].
Source§fn append<I>(&self, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
fn append<I>(&self, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
Appends an item to the list.
Source§fn insert<I>(&self, index: usize, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
fn insert<I>(&self, index: usize, item: I) -> PyResult<()>where
I: IntoPyObject<'py>,
Inserts an item at the specified index.
If index >= self.len(), inserts at the end.
Source§fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
Determines if self contains value.
This is equivalent to the Python expression value in self.
Source§fn index<V>(&self, value: V) -> PyResult<usize>where
V: IntoPyObject<'py>,
fn index<V>(&self, value: V) -> PyResult<usize>where
V: IntoPyObject<'py>,
Returns the first index i for which self[i] == value.
This is equivalent to the Python expression self.index(value).
Source§fn iter(&self) -> BoundListIterator<'py> ⓘ
fn iter(&self) -> BoundListIterator<'py> ⓘ
Returns an iterator over this list’s items.
Source§fn locked_for_each<F>(&self, closure: F) -> PyResult<()>
fn locked_for_each<F>(&self, closure: F) -> PyResult<()>
Iterates over a list while holding a critical section, calling a closure on each item
Source§fn sort(&self) -> PyResult<()>
fn sort(&self) -> PyResult<()>
Sorts the list in-place. Equivalent to the Python expression l.sort().
Source§fn reverse(&self) -> PyResult<()>
fn reverse(&self) -> PyResult<()>
Reverses the list in-place. Equivalent to the Python expression l.reverse().
Source§impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping>
impl<'py> PyMappingMethods<'py> for Bound<'py, PyMapping>
Source§fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
Source§fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>where
K: IntoPyObject<'py>,
fn get_item<K>(&self, key: K) -> PyResult<Bound<'py, PyAny>>where
K: IntoPyObject<'py>,
key. Read moreSource§fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
fn set_item<K, V>(&self, key: K, value: V) -> PyResult<()>where
K: IntoPyObject<'py>,
V: IntoPyObject<'py>,
key. Read moreSource§fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
fn del_item<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
key. Read moreSource§fn keys(&self) -> PyResult<Bound<'py, PyList>>
fn keys(&self) -> PyResult<Bound<'py, PyList>>
Source§impl<'py, 'a> PyMappingProxyMethods<'py, 'a> for Bound<'py, PyMappingProxy>
impl<'py, 'a> PyMappingProxyMethods<'py, 'a> for Bound<'py, PyMappingProxy>
Source§fn is_empty(&self) -> PyResult<bool>
fn is_empty(&self) -> PyResult<bool>
len(self) == 0.Source§fn keys(&self) -> PyResult<Bound<'py, PyList>>
fn keys(&self) -> PyResult<Bound<'py, PyList>>
Source§fn values(&self) -> PyResult<Bound<'py, PyList>>
fn values(&self) -> PyResult<Bound<'py, PyList>>
Source§fn items(&self) -> PyResult<Bound<'py, PyList>>
fn items(&self) -> PyResult<Bound<'py, PyList>>
Source§fn as_mapping(&self) -> &Bound<'py, PyMapping>
fn as_mapping(&self) -> &Bound<'py, PyMapping>
self cast as a PyMapping.Source§fn try_iter(&'a self) -> PyResult<BoundMappingProxyIterator<'py, 'a>>
fn try_iter(&'a self) -> PyResult<BoundMappingProxyIterator<'py, 'a>>
Source§impl<'py> PyModuleMethods<'py> for Bound<'py, PyModule>
impl<'py> PyModuleMethods<'py> for Bound<'py, PyModule>
Source§fn dict(&self) -> Bound<'py, PyDict>
fn dict(&self) -> Bound<'py, PyDict>
__dict__ attribute, which contains the module’s symbol table.Source§fn index(&self) -> PyResult<Bound<'py, PyList>>
fn index(&self) -> PyResult<Bound<'py, PyList>>
__all__ attribute) of the module,
creating one if needed. Read moreSource§fn name(&self) -> PyResult<Bound<'py, PyString>>
fn name(&self) -> PyResult<Bound<'py, PyString>>
__name__ attribute) of the module. Read moreSource§fn filename(&self) -> PyResult<Bound<'py, PyString>>
fn filename(&self) -> PyResult<Bound<'py, PyString>>
__file__ attribute) of the module. Read moreSource§fn add<N, V>(&self, name: N, value: V) -> PyResult<()>
fn add<N, V>(&self, name: N, value: V) -> PyResult<()>
Source§fn add_class<T>(&self) -> PyResult<()>where
T: PyClass,
fn add_class<T>(&self) -> PyResult<()>where
T: PyClass,
Source§fn add_wrapped<T>(&self, wrapper: &impl Fn(Python<'py>) -> T) -> PyResult<()>
fn add_wrapped<T>(&self, wrapper: &impl Fn(Python<'py>) -> T) -> PyResult<()>
Source§fn add_submodule(&self, module: &Bound<'_, PyModule>) -> PyResult<()>
fn add_submodule(&self, module: &Bound<'_, PyModule>) -> PyResult<()>
Source§fn add_function(&self, fun: Bound<'_, PyCFunction>) -> PyResult<()>
fn add_function(&self, fun: Bound<'_, PyCFunction>) -> PyResult<()>
Source§impl<'py> PyRangeMethods<'py> for Bound<'py, PyRange>
impl<'py> PyRangeMethods<'py> for Bound<'py, PyRange>
Source§impl<'py> PySequenceMethods<'py> for Bound<'py, PySequence>
impl<'py> PySequenceMethods<'py> for Bound<'py, PySequence>
Source§fn concat(
&self,
other: &Bound<'_, PySequence>,
) -> PyResult<Bound<'py, PySequence>>
fn concat( &self, other: &Bound<'_, PySequence>, ) -> PyResult<Bound<'py, PySequence>>
Source§fn repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>
fn repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>
count times. Read moreSource§fn in_place_concat(
&self,
other: &Bound<'_, PySequence>,
) -> PyResult<Bound<'py, PySequence>>
fn in_place_concat( &self, other: &Bound<'_, PySequence>, ) -> PyResult<Bound<'py, PySequence>>
Source§fn in_place_repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>
fn in_place_repeat(&self, count: usize) -> PyResult<Bound<'py, PySequence>>
Source§fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
indexth element of the Sequence. Read moreSource§fn count<V>(&self, value: V) -> PyResult<usize>where
V: IntoPyObject<'py>,
fn count<V>(&self, value: V) -> PyResult<usize>where
V: IntoPyObject<'py>,
PyPy only.value in self, that is, return the
number of keys for which self[key] == value.Source§fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
value. Read moreSource§impl<'py> PySetMethods<'py> for Bound<'py, PySet>
impl<'py> PySetMethods<'py> for Bound<'py, PySet>
Source§fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
fn contains<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
Source§fn discard<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
fn discard<K>(&self, key: K) -> PyResult<bool>where
K: IntoPyObject<'py>,
Source§fn add<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
fn add<K>(&self, key: K) -> PyResult<()>where
K: IntoPyObject<'py>,
Source§fn pop(&self) -> Option<Bound<'py, PyAny>>
fn pop(&self) -> Option<Bound<'py, PyAny>>
Source§impl<'py> PySliceMethods<'py> for Bound<'py, PySlice>
impl<'py> PySliceMethods<'py> for Bound<'py, PySlice>
Source§impl<'py> PyStringMethods<'py> for Bound<'py, PyString>
impl<'py> PyStringMethods<'py> for Bound<'py, PyString>
Source§fn to_str(&self) -> PyResult<&str>
fn to_str(&self) -> PyResult<&str>
Py_3_10 or non-Py_LIMITED_API only.Source§fn to_cow(&self) -> PyResult<Cow<'_, str>>
fn to_cow(&self) -> PyResult<Cow<'_, str>>
PyString into a Rust string, avoiding copying when possible. Read moreSource§impl PyTimeAccess for Bound<'_, PyDateTime>
Available on non-Py_LIMITED_API only.
impl PyTimeAccess for Bound<'_, PyDateTime>
Py_LIMITED_API only.Source§fn get_minute(&self) -> u8
fn get_minute(&self) -> u8
Source§fn get_second(&self) -> u8
fn get_second(&self) -> u8
Source§fn get_microsecond(&self) -> u32
fn get_microsecond(&self) -> u32
Source§impl PyTimeAccess for Bound<'_, PyTime>
Available on non-Py_LIMITED_API only.
impl PyTimeAccess for Bound<'_, PyTime>
Py_LIMITED_API only.Source§fn get_minute(&self) -> u8
fn get_minute(&self) -> u8
Source§fn get_second(&self) -> u8
fn get_second(&self) -> u8
Source§fn get_microsecond(&self) -> u32
fn get_microsecond(&self) -> u32
Source§impl<'py> PyTracebackMethods<'py> for Bound<'py, PyTraceback>
impl<'py> PyTracebackMethods<'py> for Bound<'py, PyTraceback>
Source§impl<'py> PyTupleMethods<'py> for Bound<'py, PyTuple>
impl<'py> PyTupleMethods<'py> for Bound<'py, PyTuple>
Source§fn as_sequence(&self) -> &Bound<'py, PySequence>
fn as_sequence(&self) -> &Bound<'py, PySequence>
self cast as a PySequence.Source§fn into_sequence(self) -> Bound<'py, PySequence>
fn into_sequence(self) -> Bound<'py, PySequence>
self cast as a PySequence.Source§fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyTuple>
fn get_slice(&self, low: usize, high: usize) -> Bound<'py, PyTuple>
self[low:high] and returns it as a new tuple. Read moreSource§fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
fn get_item(&self, index: usize) -> PyResult<Bound<'py, PyAny>>
Source§fn get_borrowed_item<'a>(
&'a self,
index: usize,
) -> PyResult<Borrowed<'a, 'py, PyAny>>
fn get_borrowed_item<'a>( &'a self, index: usize, ) -> PyResult<Borrowed<'a, 'py, PyAny>>
get_item, but returns a borrowed object, which is a slight performance optimization
by avoiding a reference count change.Source§unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny>
unsafe fn get_item_unchecked(&self, index: usize) -> Bound<'py, PyAny>
Source§unsafe fn get_borrowed_item_unchecked<'a>(
&'a self,
index: usize,
) -> Borrowed<'a, 'py, PyAny>
unsafe fn get_borrowed_item_unchecked<'a>( &'a self, index: usize, ) -> Borrowed<'a, 'py, PyAny>
get_item_unchecked, but returns a borrowed object,
which is a slight performance optimization by avoiding a reference count change. Read moreSource§fn as_slice(&self) -> &[Bound<'py, PyAny>]
fn as_slice(&self) -> &[Bound<'py, PyAny>]
GraalPy nor Py_LIMITED_API.self as a slice of objects.Source§fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
fn contains<V>(&self, value: V) -> PyResult<bool>where
V: IntoPyObject<'py>,
value. Read moreSource§fn iter(&self) -> BoundTupleIterator<'py> ⓘ
fn iter(&self) -> BoundTupleIterator<'py> ⓘ
Source§fn iter_borrowed<'a>(&'a self) -> BorrowedTupleIterator<'a, 'py> ⓘ
fn iter_borrowed<'a>(&'a self) -> BorrowedTupleIterator<'a, 'py> ⓘ
iter, but produces an iterator which returns borrowed objects,
which is a slight performance optimization by avoiding a reference count changes.Source§impl<'py> PyTypeMethods<'py> for Bound<'py, PyType>
impl<'py> PyTypeMethods<'py> for Bound<'py, PyType>
Source§fn as_type_ptr(&self) -> *mut PyTypeObject
fn as_type_ptr(&self) -> *mut PyTypeObject
Retrieves the underlying FFI pointer associated with this Python object.
Source§fn module(&self) -> PyResult<Bound<'py, PyString>>
fn module(&self) -> PyResult<Bound<'py, PyString>>
Gets the name of the module defining the PyType.
Source§fn fully_qualified_name(&self) -> PyResult<Bound<'py, PyString>>
fn fully_qualified_name(&self) -> PyResult<Bound<'py, PyString>>
Gets the fully qualified name of the PyType.
Source§fn is_subclass(&self, other: &Bound<'_, PyAny>) -> PyResult<bool>
fn is_subclass(&self, other: &Bound<'_, PyAny>) -> PyResult<bool>
Checks whether self is a subclass of other.
Equivalent to the Python expression issubclass(self, other).
Source§fn is_subclass_of<T>(&self) -> PyResult<bool>where
T: PyTypeInfo,
fn is_subclass_of<T>(&self) -> PyResult<bool>where
T: PyTypeInfo,
Checks whether self is a subclass of type T.
Equivalent to the Python expression issubclass(self, T), if the type
T is known at compile time.
Source§impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyDateTime>
impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyDateTime>
Source§impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyTime>
impl<'py> PyTzInfoAccess<'py> for Bound<'py, PyTime>
Source§impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakref>
impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakref>
Source§fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
Source§unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
weakref may still return None. Read moreSource§fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
Source§impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefProxy>
impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefProxy>
Source§fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
Source§unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
weakref may still return None. Read moreSource§fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
Source§impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefReference>
impl<'py> PyWeakrefMethods<'py> for Bound<'py, PyWeakrefReference>
Source§fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
fn upgrade_as<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeCheck,
Source§unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
unsafe fn upgrade_as_unchecked<T>(&self) -> Option<Bound<'py, T>>
weakref may still return None. Read moreSource§fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
fn upgrade_as_exact<T>(&self) -> PyResult<Option<Bound<'py, T>>>where
T: PyTypeInfo,
impl Sealed for Bound<'_, PyAny>
impl Sealed for Bound<'_, PyBool>
impl Sealed for Bound<'_, PyByteArray>
impl Sealed for Bound<'_, PyBytes>
impl Sealed for Bound<'_, PyCapsule>
impl Sealed for Bound<'_, PyComplex>
impl Sealed for Bound<'_, PyDict>
impl Sealed for Bound<'_, PyFloat>
impl Sealed for Bound<'_, PyFrozenSet>
impl Sealed for Bound<'_, PyList>
impl Sealed for Bound<'_, PyMapping>
impl Sealed for Bound<'_, PyMappingProxy>
impl Sealed for Bound<'_, PyModule>
impl Sealed for Bound<'_, PyRange>
impl Sealed for Bound<'_, PySequence>
impl Sealed for Bound<'_, PySet>
impl Sealed for Bound<'_, PySlice>
impl Sealed for Bound<'_, PyString>
impl Sealed for Bound<'_, PyTraceback>
impl Sealed for Bound<'_, PyFrame>
GraalPy and non-Py_LIMITED_API and non-PyPy only.impl Sealed for Bound<'_, PyTuple>
impl Sealed for Bound<'_, PyType>
impl Sealed for Bound<'_, PyWeakref>
impl Sealed for Bound<'_, PyWeakrefProxy>
impl Sealed for Bound<'_, PyWeakrefReference>
impl<'py> Sealed for Bound<'py, PyModule>
impl<'py> Sealed for &Bound<'py, PyModule>
impl Sealed for Bound<'_, PyTuple>
impl Sealed for &Bound<'_, PyTuple>
impl<T> Sealed for Bound<'_, T>
impl<'py, T: PyTypeCheck + 'py> Sealed<false> for &Bound<'py, T>
Source§impl<'py> Sub for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Sub for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Sub for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Sub for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Sub<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Sub<&Bound<'py, PyComplex>> for Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'py> Sub<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
Available on neither GraalPy nor Py_LIMITED_API nor PyPy.
impl<'py> Sub<Bound<'py, PyComplex>> for &Bound<'py, PyComplex>
GraalPy nor Py_LIMITED_API nor PyPy.Source§impl<'a, 'py, T: PyClass<Frozen = False>> TryFrom<&'a Bound<'py, T>> for PyClassGuardMut<'a, T>
impl<'a, 'py, T: PyClass<Frozen = False>> TryFrom<&'a Bound<'py, T>> for PyClassGuardMut<'a, T>
Source§impl<'py> TryInto<Bound<'py, PyString>> for PyUnicodeWriter<'py>
Available on Py_3_14 and non-Py_LIMITED_API only.
impl<'py> TryInto<Bound<'py, PyString>> for PyUnicodeWriter<'py>
Py_3_14 and non-Py_LIMITED_API only.Source§impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Bound<'py, PyModule>
impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Bound<'py, PyModule>
fn wrap_pyfunction( self, function_def: &'static PyFunctionDef, ) -> PyResult<Bound<'py, PyCFunction>>
Source§impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &Bound<'py, PyModule>
impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &Bound<'py, PyModule>
fn wrap_pyfunction( self, function_def: &'static PyFunctionDef, ) -> PyResult<Bound<'py, PyCFunction>>
Source§impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Borrowed<'_, 'py, PyModule>
impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Borrowed<'_, 'py, PyModule>
fn wrap_pyfunction( self, function_def: &'static PyFunctionDef, ) -> PyResult<Bound<'py, PyCFunction>>
Source§impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &Borrowed<'_, 'py, PyModule>
impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for &Borrowed<'_, 'py, PyModule>
fn wrap_pyfunction( self, function_def: &'static PyFunctionDef, ) -> PyResult<Bound<'py, PyCFunction>>
Source§impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Python<'py>
impl<'py> WrapPyFunctionArg<'py, Bound<'py, PyCFunction>> for Python<'py>
fn wrap_pyfunction( self, function_def: &'static PyFunctionDef, ) -> PyResult<Bound<'py, PyCFunction>>
Auto Trait Implementations§
impl<'py, T> !Send for Bound<'py, T>
impl<'py, T> !Sync for Bound<'py, T>
impl<'py, T> Freeze for Bound<'py, T>
impl<'py, T> RefUnwindSafe for Bound<'py, T>where
T: RefUnwindSafe,
impl<'py, T> Unpin for Bound<'py, T>where
T: Unpin,
impl<'py, T> UnsafeUnpin for Bound<'py, T>
impl<'py, T> UnwindSafe for Bound<'py, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<I> IntoIterator for Iwhere
I: Iterator,
impl<I> IntoIterator for Iwhere
I: Iterator,
Source§impl<'py, T> IntoPyCallbackOutput<'py, *mut PyObject> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyCallbackOutput<'py, *mut PyObject> for Twhere
T: IntoPyObject<'py>,
Source§impl<'py, T> IntoPyCallbackOutput<'py, Py<PyAny>> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyCallbackOutput<'py, Py<PyAny>> for Twhere
T: IntoPyObject<'py>,
Source§impl<'py, T, I> IntoPyDict<'py> for Iwhere
T: PyDictItem<'py>,
I: IntoIterator<Item = T>,
impl<'py, T, I> IntoPyDict<'py> for Iwhere
T: PyDictItem<'py>,
I: IntoIterator<Item = T>,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>>
fn into_bound_py_any(self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>>
self into an owned Python object, dropping type information.Source§impl<'a, 'py, T> PyFunctionArgument<'a, '_, 'py, true> for Twhere
T: FromPyObject<'a, 'py>,
impl<'a, 'py, T> PyFunctionArgument<'a, '_, 'py, true> for Twhere
T: FromPyObject<'a, 'py>,
Source§const INPUT_TYPE: PyStaticExpr = const INPUT_TYPE: PyStaticExpr = T::INPUT_TYPE;
const INPUT_TYPE: PyStaticExpr = const INPUT_TYPE: PyStaticExpr = T::INPUT_TYPE;
experimental-inspect only.type Holder = ()
type Error = <T as FromPyObject<'a, 'py>>::Error
fn extract( obj: Borrowed<'a, 'py, PyAny>, _: &mut (), ) -> Result<T, <T as PyFunctionArgument<'a, '_, 'py, true>>::Error>
impl<'py, T> PyO3GetField<'py> for Twhere
T: IntoPyObject<'py> + Clone,
Source§impl<'a, T> PyReturnType for Twhere
T: IntoPyObject<'a>,
impl<'a, T> PyReturnType for Twhere
T: IntoPyObject<'a>,
Source§const OUTPUT_TYPE: PyStaticExpr = const OUTPUT_TYPE: PyStaticExpr = T::OUTPUT_TYPE;
const OUTPUT_TYPE: PyStaticExpr = const OUTPUT_TYPE: PyStaticExpr = T::OUTPUT_TYPE;
experimental-inspect only.impl<'a, T> Sealed for Twhere
T: IntoPyObject<'a>,
impl<'py, T> Sealed for Twhere
T: IntoPyObject<'py>,
impl<'py, T> Sealed for Twhere
T: IntoPyObject<'py>,
impl<'py, T> Sealed<'py, *mut PyObject> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> Sealed<'py, Py<PyAny>> for Twhere
T: IntoPyObject<'py>,
impl<'a, 'py, T> Sealed<true> for Twhere
T: FromPyObject<'a, 'py>,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read more