240 lines
148 KiB
HTML
240 lines
148 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A borrowed equivalent to `Bound`."><title>Borrowed in pyo3::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-46132b98.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="pyo3" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.1 (4eb161250 2025-03-15)" data-channel="1.85.1" data-search-js="search-75f5ac3e.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../pyo3/index.html">pyo3</a><span class="version">0.24.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Borrowed</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.as_ptr" title="as_ptr">as_ptr</a></li><li><a href="#method.from_ptr" title="from_ptr">from_ptr</a></li><li><a href="#method.from_ptr_or_err" title="from_ptr_or_err">from_ptr_or_err</a></li><li><a href="#method.from_ptr_or_opt" title="from_ptr_or_opt">from_ptr_or_opt</a></li><li><a href="#method.to_owned" title="to_owned">to_owned</a></li></ul><h3><a href="#deref-methods-Bound%3C'py,+T%3E">Methods from Deref<<wbr>Target=<wbr>Bound<'py, T>></a></h3><ul class="block deref-methods"><li><a href="#method.as_any" title="as_any">as_any</a></li><li><a href="#method.as_borrowed" title="as_borrowed">as_borrowed</a></li><li><a href="#method.as_ptr-1" title="as_ptr">as_ptr</a></li><li><a href="#method.as_super" title="as_super">as_super</a></li><li><a href="#method.as_unbound" title="as_unbound">as_unbound</a></li><li><a href="#method.borrow" title="borrow">borrow</a></li><li><a href="#method.borrow_mut" title="borrow_mut">borrow_mut</a></li><li><a href="#method.get" title="get">get</a></li><li><a href="#method.py" title="py">py</a></li><li><a href="#method.send" title="send">send</a></li><li><a href="#method.try_borrow" title="try_borrow">try_borrow</a></li><li><a href="#method.try_borrow_mut" title="try_borrow_mut">try_borrow_mut</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Add-for-Borrowed%3C'_,+'py,+PyComplex%3E" title="Add">Add</a></li><li><a href="#impl-BoundObject%3C'py,+T%3E-for-Borrowed%3C'a,+'py,+T%3E" title="BoundObject<'py, T>">BoundObject<'py, T></a></li><li><a href="#impl-Clone-for-Borrowed%3C'_,+'_,+T%3E" title="Clone">Clone</a></li><li><a href="#impl-Copy-for-Borrowed%3C'_,+'_,+T%3E" title="Copy">Copy</a></li><li><a href="#impl-Debug-for-Borrowed%3C'_,+'_,+T%3E" title="Debug">Debug</a></li><li><a href="#impl-Deref-for-Borrowed%3C'_,+'py,+T%3E" title="Deref">Deref</a></li><li><a href="#impl-Div-for-Borrowed%3C'_,+'py,+PyComplex%3E" title="Div">Div</a></li><li><a href="#impl-From%3C%26Bound%3C'py,+T%3E%3E-for-Borrowed%3C'a,+'py,+T%3E" title="From<&'a Bound<'py, T>>">From<&'a Bound<'py, T>></a></li><li><a href="#impl-IntoPy%3CPy%3CPyAny%3E%3E-for-Borrowed%3C'_,+'_,+T%3E" title="IntoPy<Py<PyAny>>">IntoPy<Py<PyAny>></a></li><li><a href="#impl-IntoPyObject%3C'py%3E-for-%26Borrowed%3C'a,+'py,+T%3E" title="IntoPyObject<'py>">IntoPyObject<'py></a></li><li><a href="#impl-IntoPyObject%3C'py%3E-for-Borrowed%3C'a,+'py,+T%3E" title="IntoPyObject<'py>">IntoPyObject<'py></a></li><li><a href="#impl-Mul-for-Borrowed%3C'_,+'py,+PyComplex%3E" title="Mul">Mul</a></li><li><a href="#impl-Neg-for-Borrowed%3C'_,+'py,+PyComplex%3E" title="Neg">Neg</a></li><li><a href="#impl-PartialEq%3C%26%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" title="PartialEq<&[u8]>">PartialEq<&[u8]></a></li><li><a href="#impl-PartialEq%3C%26bool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" title="PartialEq<&bool>">PartialEq<&bool></a></li><li><a href="#impl-PartialEq%3C%26f32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" title="PartialEq<&f32>">PartialEq<&f32></a></li><li><a href="#impl-PartialEq%3C%26f64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" title="PartialEq<&f64>">PartialEq<&f64></a></li><li><a href="#impl-PartialEq%3C%26str%3E-for-Borrowed%3C'_,+'_,+PyString%3E" title="PartialEq<&str>">PartialEq<&str></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-%26bool" title="PartialEq<Borrowed<'_, '_, PyBool>>">PartialEq<Borrowed<'_, '_, PyBool>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-bool" title="PartialEq<Borrowed<'_, '_, PyBool>>">PartialEq<Borrowed<'_, '_, PyBool>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%26%5Bu8%5D" title="PartialEq<Borrowed<'_, '_, PyBytes>>">PartialEq<Borrowed<'_, '_, PyBytes>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%5Bu8%5D" title="PartialEq<Borrowed<'_, '_, PyBytes>>">PartialEq<Borrowed<'_, '_, PyBytes>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f32" title="PartialEq<Borrowed<'_, '_, PyFloat>>">PartialEq<Borrowed<'_, '_, PyFloat>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f64" title="PartialEq<Borrowed<'_, '_, PyFloat>>">PartialEq<Borrowed<'_, '_, PyFloat>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f32" title="PartialEq<Borrowed<'_, '_, PyFloat>>">PartialEq<Borrowed<'_, '_, PyFloat>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f64" title="PartialEq<Borrowed<'_, '_, PyFloat>>">PartialEq<Borrowed<'_, '_, PyFloat>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-%26str" title="PartialEq<Borrowed<'_, '_, PyString>>">PartialEq<Borrowed<'_, '_, PyString>></a></li><li><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-str" title="PartialEq<Borrowed<'_, '_, PyString>>">PartialEq<Borrowed<'_, '_, PyString>></a></li><li><a href="#impl-PartialEq%3C%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" title="PartialEq<[u8]>">PartialEq<[u8]></a></li><li><a href="#impl-PartialEq%3Cbool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" title="PartialEq<bool>">PartialEq<bool></a></li><li><a href="#impl-PartialEq%3Cf32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" title="PartialEq<f32>">PartialEq<f32></a></li><li><a href="#impl-PartialEq%3Cf64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" title="PartialEq<f64>">PartialEq<f64></a></li><li><a href="#impl-PartialEq%3Cstr%3E-for-Borrowed%3C'_,+'_,+PyString%3E" title="PartialEq<str>">PartialEq<str></a></li><li><a href="#impl-PyCallArgs%3C'py%3E-for-Borrowed%3C'_,+'py,+PyTuple%3E" title="PyCallArgs<'py>">PyCallArgs<'py></a></li><li><a href="#impl-Sub-for-Borrowed%3C'_,+'py,+PyComplex%3E" title="Sub">Sub</a></li><li><a href="#impl-ToPyObject-for-Borrowed%3C'_,+'_,+T%3E" title="ToPyObject">ToPyObject</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Send-for-Borrowed%3C'a,+'py,+T%3E" title="!Send">!Send</a></li><li><a href="#impl-Sync-for-Borrowed%3C'a,+'py,+T%3E" title="!Sync">!Sync</a></li><li><a href="#impl-Freeze-for-Borrowed%3C'a,+'py,+T%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Unpin-for-Borrowed%3C'a,+'py,+T%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-IntoPyObjectExt%3C'py%3E-for-T" title="IntoPyObjectExt<'py>">IntoPyObjectExt<'py></a></li><li><a href="#impl-Receiver-for-P" title="Receiver">Receiver</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pyo3::<wbr>prelude</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">pyo3</a>::<wbr><a href="index.html">prelude</a></span><h1>Struct <span class="struct">Borrowed</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/pyo3/instance.rs.html#658">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Borrowed<'a, 'py, T>(<span class="comment">/* private fields */</span>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A borrowed equivalent to <code>Bound</code>.</p>
|
||
<p>The advantage of this over <code>&Bound</code> is that it avoids the need to have a pointer-to-pointer, as Bound
|
||
is already a pointer to an `ffi::PyObject``.</p>
|
||
<p>Similarly, this type is <code>Copy</code> and <code>Clone</code>, like a shared reference (<code>&T</code>).</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Borrowed%3C'a,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#660-705">Source</a><a href="#impl-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#685-687">Source</a><h4 class="code-header">pub fn <a href="#method.to_owned" class="fn">to_owned</a>(self) -> <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T></h4></section></summary><div class="docblock"><p>Creates a new owned <a href="../struct.Bound.html" title="struct pyo3::Bound"><code>Bound<T></code></a> from this borrowed reference by
|
||
increasing the reference count.</p>
|
||
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>pyo3::{prelude::<span class="kw-2">*</span>, types::PyTuple};
|
||
|
||
Python::with_gil(|py| -> PyResult<()> {
|
||
<span class="kw">let </span>tuple = PyTuple::new(py, [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>])<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// borrows from `tuple`, so can only be
|
||
// used while `tuple` stays alive
|
||
</span><span class="kw">let </span>borrowed = tuple.get_borrowed_item(<span class="number">0</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="comment">// creates a new owned reference, which
|
||
// can be used indendently of `tuple`
|
||
</span><span class="kw">let </span>bound = borrowed.to_owned();
|
||
drop(tuple);
|
||
|
||
<span class="macro">assert_eq!</span>(bound.extract::<i32>().unwrap(), <span class="number">1</span>);
|
||
<span class="prelude-val">Ok</span>(())
|
||
})</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#698-700">Source</a><h4 class="code-header">pub fn <a href="#method.as_ptr" class="fn">as_ptr</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a></h4></section></summary><div class="docblock"><p>Returns the raw FFI pointer represented by self.</p>
|
||
<h5 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h5>
|
||
<p>Callers are responsible for ensuring that the pointer does not outlive self.</p>
|
||
<p>The reference is borrowed; callers should not decrease the reference count
|
||
when they are finished with the pointer.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Borrowed%3C'a,+'py,+PyAny%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#707-795">Source</a><a href="#impl-Borrowed%3C'a,+'py,+PyAny%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py> <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, <a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from_ptr" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#721-727">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_ptr" class="fn">from_ptr</a>(py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>, ptr: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a>) -> Self</h4></section></summary><div class="docblock"><p>Constructs a new <code>Borrowed<'a, 'py, PyAny></code> from a pointer. Panics if <code>ptr</code> is null.</p>
|
||
<p>Prefer to use <a href="../struct.Bound.html#method.from_borrowed_ptr" title="associated function pyo3::Bound::from_borrowed_ptr"><code>Bound::from_borrowed_ptr</code></a>, as that avoids the major safety risk
|
||
of needing to precisely define the lifetime <code>'a</code> for which the borrow is valid.</p>
|
||
<h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
|
||
<ul>
|
||
<li><code>ptr</code> must be a valid pointer to a Python object</li>
|
||
<li>similar to <code>std::slice::from_raw_parts</code>, the lifetime <code>'a</code> is completely defined by
|
||
the caller and it is the caller’s responsibility to ensure that the reference this is
|
||
derived from is valid for the lifetime <code>'a</code>.</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_ptr_or_opt" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#741-743">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_ptr_or_opt" class="fn">from_ptr_or_opt</a>(
|
||
py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>,
|
||
ptr: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self></h4></section></summary><div class="docblock"><p>Constructs a new <code>Borrowed<'a, 'py, PyAny></code> from a pointer. Returns <code>None</code> if <code>ptr</code> is null.</p>
|
||
<p>Prefer to use <a href="../struct.Bound.html#method.from_borrowed_ptr_or_opt" title="associated function pyo3::Bound::from_borrowed_ptr_or_opt"><code>Bound::from_borrowed_ptr_or_opt</code></a>, as that avoids the major safety risk
|
||
of needing to precisely define the lifetime <code>'a</code> for which the borrow is valid.</p>
|
||
<h5 id="safety-2"><a class="doc-anchor" href="#safety-2">§</a>Safety</h5>
|
||
<ul>
|
||
<li><code>ptr</code> must be a valid pointer to a Python object, or null</li>
|
||
<li>similar to <code>std::slice::from_raw_parts</code>, the lifetime <code>'a</code> is completely defined by
|
||
the caller and it is the caller’s responsibility to ensure that the reference this is
|
||
derived from is valid for the lifetime <code>'a</code>.</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_ptr_or_err" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#758-763">Source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_ptr_or_err" class="fn">from_ptr_or_err</a>(
|
||
py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>,
|
||
ptr: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a>,
|
||
) -> <a class="type" href="../type.PyResult.html" title="type pyo3::PyResult">PyResult</a><Self></h4></section></summary><div class="docblock"><p>Constructs a new <code>Borrowed<'a, 'py, PyAny></code> from a pointer. Returns an <code>Err</code> by calling <code>PyErr::fetch</code>
|
||
if <code>ptr</code> is null.</p>
|
||
<p>Prefer to use <a href="../struct.Bound.html#method.from_borrowed_ptr_or_err" title="associated function pyo3::Bound::from_borrowed_ptr_or_err"><code>Bound::from_borrowed_ptr_or_err</code></a>, as that avoids the major safety risk
|
||
of needing to precisely define the lifetime <code>'a</code> for which the borrow is valid.</p>
|
||
<h5 id="safety-3"><a class="doc-anchor" href="#safety-3">§</a>Safety</h5>
|
||
<ul>
|
||
<li><code>ptr</code> must be a valid pointer to a Python object, or null</li>
|
||
<li>similar to <code>std::slice::from_raw_parts</code>, the lifetime <code>'a</code> is completely defined by
|
||
the caller and it is the caller’s responsibility to ensure that the reference this is
|
||
derived from is valid for the lifetime <code>'a</code>.</li>
|
||
</ul>
|
||
</div></details></div></details></div><details class="toggle big-toggle" open><summary><h2 id="deref-methods-Bound%3C'py,+T%3E" class="section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T>></span><a href="#deref-methods-Bound%3C'py,+T%3E" class="anchor">§</a></h2></summary><div id="deref-methods-Bound%3C'py,+T%3E-1" class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#268-270">Source</a><h4 class="code-header">pub fn <a href="#method.borrow" class="fn">borrow</a>(&self) -> <a class="struct" href="../pycell/struct.PyRef.html" title="struct pyo3::pycell::PyRef">PyRef</a><'py, T></h4></section></summary><div class="docblock"><p>Immutably borrows the value <code>T</code>.</p>
|
||
<p>This borrow lasts while the returned <a href="../pycell/struct.PyRef.html" title="struct pyo3::pycell::PyRef"><code>PyRef</code></a> exists.
|
||
Multiple immutable borrows can be taken out at the same time.</p>
|
||
<p>For frozen classes, the simpler <a href="../struct.Bound.html#method.get" title="method pyo3::Bound::get"><code>get</code></a> is available.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[pyclass]
|
||
</span><span class="kw">struct </span>Foo {
|
||
inner: u8,
|
||
}
|
||
|
||
Python::with_gil(|py| -> PyResult<()> {
|
||
<span class="kw">let </span>foo: Bound<<span class="lifetime">'_</span>, Foo> = Bound::new(py, Foo { inner: <span class="number">73 </span>})<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>inner: <span class="kw-2">&</span>u8 = <span class="kw-2">&</span>foo.borrow().inner;
|
||
|
||
<span class="macro">assert_eq!</span>(<span class="kw-2">*</span>inner, <span class="number">73</span>);
|
||
<span class="prelude-val">Ok</span>(())
|
||
})<span class="question-mark">?</span>;</code></pre></div>
|
||
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
|
||
<p>Panics if the value is currently mutably borrowed. For a non-panicking variant, use
|
||
<a href="#method.try_borrow"><code>try_borrow</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#303-308">Source</a><h4 class="code-header">pub fn <a href="#method.borrow_mut" class="fn">borrow_mut</a>(&self) -> <a class="struct" href="../pycell/struct.PyRefMut.html" title="struct pyo3::pycell::PyRefMut">PyRefMut</a><'py, T><div class="where">where
|
||
T: <a class="trait" href="../pyclass/trait.PyClass.html" title="trait pyo3::pyclass::PyClass">PyClass</a><Frozen = False>,</div></h4></section></summary><div class="docblock"><p>Mutably borrows the value <code>T</code>.</p>
|
||
<p>This borrow lasts while the returned <a href="../pycell/struct.PyRefMut.html" title="struct pyo3::pycell::PyRefMut"><code>PyRefMut</code></a> exists.</p>
|
||
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[pyclass]
|
||
</span><span class="kw">struct </span>Foo {
|
||
inner: u8,
|
||
}
|
||
|
||
Python::with_gil(|py| -> PyResult<()> {
|
||
<span class="kw">let </span>foo: Bound<<span class="lifetime">'_</span>, Foo> = Bound::new(py, Foo { inner: <span class="number">73 </span>})<span class="question-mark">?</span>;
|
||
foo.borrow_mut().inner = <span class="number">35</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(foo.borrow().inner, <span class="number">35</span>);
|
||
<span class="prelude-val">Ok</span>(())
|
||
})<span class="question-mark">?</span>;</code></pre></div>
|
||
<h5 id="panics-1"><a class="doc-anchor" href="#panics-1">§</a>Panics</h5>
|
||
<p>Panics if the value is currently borrowed. For a non-panicking variant, use
|
||
<a href="#method.try_borrow_mut"><code>try_borrow_mut</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_borrow" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#318-320">Source</a><h4 class="code-header">pub fn <a href="#method.try_borrow" class="fn">try_borrow</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../pycell/struct.PyRef.html" title="struct pyo3::pycell::PyRef">PyRef</a><'py, T>, <a class="struct" href="../pycell/struct.PyBorrowError.html" title="struct pyo3::pycell::PyBorrowError">PyBorrowError</a>></h4></section></summary><div class="docblock"><p>Attempts to immutably borrow the value <code>T</code>, returning an error if the value is currently mutably borrowed.</p>
|
||
<p>The borrow lasts while the returned <a href="../pycell/struct.PyRef.html" title="struct pyo3::pycell::PyRef"><code>PyRef</code></a> exists.</p>
|
||
<p>This is the non-panicking variant of <a href="#method.borrow"><code>borrow</code></a>.</p>
|
||
<p>For frozen classes, the simpler <a href="../struct.Bound.html#method.get" title="method pyo3::Bound::get"><code>get</code></a> is available.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.try_borrow_mut" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#328-333">Source</a><h4 class="code-header">pub fn <a href="#method.try_borrow_mut" class="fn">try_borrow_mut</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../pycell/struct.PyRefMut.html" title="struct pyo3::pycell::PyRefMut">PyRefMut</a><'py, T>, <a class="struct" href="../pycell/struct.PyBorrowMutError.html" title="struct pyo3::pycell::PyBorrowMutError">PyBorrowMutError</a>><div class="where">where
|
||
T: <a class="trait" href="../pyclass/trait.PyClass.html" title="trait pyo3::pyclass::PyClass">PyClass</a><Frozen = False>,</div></h4></section></summary><div class="docblock"><p>Attempts to mutably borrow the value <code>T</code>, returning an error if the value is currently borrowed.</p>
|
||
<p>The borrow lasts while the returned <a href="../pycell/struct.PyRefMut.html" title="struct pyo3::pycell::PyRefMut"><code>PyRefMut</code></a> exists.</p>
|
||
<p>This is the non-panicking variant of <a href="#method.borrow_mut"><code>borrow_mut</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#359-364">Source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&T</a><div class="where">where
|
||
T: <a class="trait" href="../pyclass/trait.PyClass.html" title="trait pyo3::pyclass::PyClass">PyClass</a><Frozen = True> + <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h4></section></summary><div class="docblock"><p>Provide an immutable borrow of the value <code>T</code> without acquiring the GIL.</p>
|
||
<p>This is available if the class is <a href="../attr.pyclass.html" title="attr pyo3::pyclass"><code>frozen</code></a> and <a href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
|
||
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::sync::atomic::{AtomicUsize, Ordering};
|
||
|
||
<span class="attr">#[pyclass(frozen)]
|
||
</span><span class="kw">struct </span>FrozenCounter {
|
||
value: AtomicUsize,
|
||
}
|
||
|
||
Python::with_gil(|py| {
|
||
<span class="kw">let </span>counter = FrozenCounter { value: AtomicUsize::new(<span class="number">0</span>) };
|
||
|
||
<span class="kw">let </span>py_counter = Bound::new(py, counter).unwrap();
|
||
|
||
py_counter.get().value.fetch_add(<span class="number">1</span>, Ordering::Relaxed);
|
||
});</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_super" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#413-416">Source</a><h4 class="code-header">pub fn <a href="#method.as_super" class="fn">as_super</a>(&self) -> &<a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T::BaseType></h4></section></summary><div class="docblock"><p>Upcast this <code>Bound<PyClass></code> to its base type by reference.</p>
|
||
<p>If this type defined an explicit base class in its <code>pyclass</code> declaration
|
||
(e.g. <code>#[pyclass(extends = BaseType)]</code>), the returned type will be
|
||
<code>&Bound<BaseType></code>. If an explicit base class was <em>not</em> declared, the
|
||
return value will be <code>&Bound<PyAny></code> (making this method equivalent
|
||
to <a href="../struct.Bound.html#method.as_any" title="method pyo3::Bound::as_any"><code>as_any</code></a>).</p>
|
||
<p>This method is particularly useful for calling methods defined in an
|
||
extension trait that has been implemented for <code>Bound<BaseType></code>.</p>
|
||
<p>See also the <a href="../struct.Bound.html#method.into_super" title="method pyo3::Bound::into_super"><code>into_super</code></a> method to upcast by value, and the
|
||
<a href="../pycell/struct.PyRef.html#method.as_super" title="method pyo3::pycell::PyRef::as_super"><code>PyRef::as_super</code></a>/<a href="../pycell/struct.PyRefMut.html#method.as_super" title="method pyo3::pycell::PyRefMut::as_super"><code>PyRefMut::as_super</code></a> methods for upcasting a pyclass
|
||
that has already been <a href="../struct.Bound.html#method.borrow" title="method pyo3::Bound::borrow"><code>borrow</code></a>ed.</p>
|
||
<h5 id="example-calling-a-method-defined-on-the-bound-base-type"><a class="doc-anchor" href="#example-calling-a-method-defined-on-the-bound-base-type">§</a>Example: Calling a method defined on the <code>Bound</code> base type</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>pyo3::prelude::<span class="kw-2">*</span>;
|
||
|
||
<span class="attr">#[pyclass(subclass)]
|
||
</span><span class="kw">struct </span>BaseClass;
|
||
|
||
<span class="kw">trait </span>MyClassMethods<<span class="lifetime">'py</span>> {
|
||
<span class="kw">fn </span>pyrepr(<span class="kw-2">&</span><span class="self">self</span>) -> PyResult<String>;
|
||
}
|
||
<span class="kw">impl</span><<span class="lifetime">'py</span>> MyClassMethods<<span class="lifetime">'py</span>> <span class="kw">for </span>Bound<<span class="lifetime">'py</span>, BaseClass> {
|
||
<span class="kw">fn </span>pyrepr(<span class="kw-2">&</span><span class="self">self</span>) -> PyResult<String> {
|
||
<span class="self">self</span>.call_method0(<span class="string">"__repr__"</span>)<span class="question-mark">?</span>.extract()
|
||
}
|
||
}
|
||
|
||
<span class="attr">#[pyclass(extends = BaseClass)]
|
||
</span><span class="kw">struct </span>SubClass;
|
||
|
||
Python::with_gil(|py| {
|
||
<span class="kw">let </span>obj = Bound::new(py, (SubClass, BaseClass)).unwrap();
|
||
<span class="macro">assert!</span>(obj.as_super().pyrepr().is_ok());
|
||
})</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.py" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#545-547">Source</a><h4 class="code-header">pub fn <a href="#method.py" class="fn">py</a>(&self) -> <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py></h4></section></summary><div class="docblock"><p>Returns the GIL token associated with this object.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr-1" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#558-560">Source</a><h4 class="code-header">pub fn <a href="#method.as_ptr-1" class="fn">as_ptr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a></h4></section></summary><div class="docblock"><p>Returns the raw FFI pointer represented by self.</p>
|
||
<h5 id="safety-4"><a class="doc-anchor" href="#safety-4">§</a>Safety</h5>
|
||
<p>Callers are responsible for ensuring that the pointer does not outlive self.</p>
|
||
<p>The reference is borrowed; callers should not decrease the reference count
|
||
when they are finished with the pointer.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_any" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#575-579">Source</a><h4 class="code-header">pub fn <a href="#method.as_any" class="fn">as_any</a>(&self) -> &<a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>></h4></section></summary><div class="docblock"><p>Helper to cast to <code>Bound<'py, PyAny></code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_borrowed" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#590-596">Source</a><h4 class="code-header">pub fn <a href="#method.as_borrowed" class="fn">as_borrowed</a><'a>(&'a self) -> <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h4></section></summary><div class="docblock"><p>Casts this <code>Bound<T></code> to a <code>Borrowed<T></code> smart pointer.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.as_unbound" class="method"><a class="src rightside" href="../../src/pyo3/instance.rs.html#611-613">Source</a><h4 class="code-header">pub fn <a href="#method.as_unbound" class="fn">as_unbound</a>(&self) -> &<a class="struct" href="../struct.Py.html" title="struct pyo3::Py">Py</a><T></h4></section></summary><div class="docblock"><p>Removes the connection for this <code>Bound<T></code> from the GIL, allowing
|
||
it to cross thread boundaries, without transferring ownership.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.send" class="method"><a class="src rightside" href="../../src/pyo3/types/iterator.rs.html#69-81">Source</a><h4 class="code-header">pub fn <a href="#method.send" class="fn">send</a>(&self, value: &<a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>>) -> <a class="type" href="../type.PyResult.html" title="type pyo3::PyResult">PyResult</a><PySendResult<'py>></h4></section></summary><div class="docblock"><p>Sends a value into a python generator. This is the equivalent of calling <code>generator.send(value)</code> in Python.
|
||
This resumes the generator and continues its execution until the next <code>yield</code> or <code>return</code> statement.
|
||
If the generator exits without returning a value, this function returns a <code>StopException</code>.
|
||
The first call to <code>send</code> must be made with <code>None</code> as the argument to start the generator, failing to do so will raise a <code>TypeError</code>.</p>
|
||
</div></details></div></details><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Add-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#105">Source</a><a href="#impl-Add-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#105">Source</a><a href="#associatedtype.Output-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Add.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h4></section></summary><div class='docblock'>The resulting type after applying the <code>+</code> operator.</div></details><details class="toggle method-toggle" open><summary><section id="method.add" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#105">Source</a><a href="#method.add" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Add.html#tymethod.add" class="fn">add</a>(self, other: Self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Add.html#associatedtype.Output" title="type core::ops::arith::Add::Output">Output</a></h4></section></summary><div class='docblock'>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-BoundObject%3C'py,+T%3E-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#848-874">Source</a><a href="#impl-BoundObject%3C'py,+T%3E-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="../trait.BoundObject.html" title="trait pyo3::BoundObject">BoundObject</a><'py, T> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Any" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#849">Source</a><a href="#associatedtype.Any" class="anchor">§</a><h4 class="code-header">type <a href="../trait.BoundObject.html#associatedtype.Any" class="associatedtype">Any</a> = <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, <a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>></h4></section></summary><div class='docblock'>Type erased version of <code>Self</code></div></details><details class="toggle method-toggle" open><summary><section id="method.as_borrowed-1" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#851-853">Source</a><a href="#method.as_borrowed-1" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.as_borrowed" class="fn">as_borrowed</a>(&self) -> <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h4></section></summary><div class='docblock'>Borrow this smart pointer.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_bound" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#855-857">Source</a><a href="#method.into_bound" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.into_bound" class="fn">into_bound</a>(self) -> <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T></h4></section></summary><div class='docblock'>Turns this smart pointer into an owned [<code>Bound<'py, T></code>]</div></details><details class="toggle method-toggle" open><summary><section id="method.into_any" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#859-861">Source</a><a href="#method.into_any" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.into_any" class="fn">into_any</a>(self) -> Self::<a class="associatedtype" href="../trait.BoundObject.html#associatedtype.Any" title="type pyo3::BoundObject::Any">Any</a></h4></section></summary><div class='docblock'>Upcast the target type of this smart pointer</div></details><details class="toggle method-toggle" open><summary><section id="method.into_ptr" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#863-865">Source</a><a href="#method.into_ptr" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.into_ptr" class="fn">into_ptr</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a></h4></section></summary><div class='docblock'>Turn this smart pointer into a strong reference pointer</div></details><details class="toggle method-toggle" open><summary><section id="method.as_ptr-2" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#867-869">Source</a><a href="#method.as_ptr-2" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.as_ptr" class="fn">as_ptr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="struct" href="../ffi/struct.PyObject.html" title="struct pyo3::ffi::PyObject">PyObject</a></h4></section></summary><div class='docblock'>Turn this smart pointer into a borrowed reference pointer</div></details><details class="toggle method-toggle" open><summary><section id="method.unbind" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#871-873">Source</a><a href="#method.unbind" class="anchor">§</a><h4 class="code-header">fn <a href="../trait.BoundObject.html#tymethod.unbind" class="fn">unbind</a>(self) -> <a class="struct" href="../struct.Py.html" title="struct pyo3::Py">Py</a><T></h4></section></summary><div class='docblock'>Turn this smart pointer into an owned <a href="../struct.Py.html" title="struct pyo3::Py"><code>Py<T></code></a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-Borrowed%3C'_,+'_,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#821-826">Source</a><a href="#impl-Clone-for-Borrowed%3C'_,+'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#823-825">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> Self</h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Borrowed%3C'_,+'_,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#805-809">Source</a><a href="#impl-Debug-for-Borrowed%3C'_,+'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#806-808">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.85.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.85.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.85.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Deref-for-Borrowed%3C'_,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#811-819">Source</a><a href="#impl-Deref-for-Borrowed%3C'_,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#812">Source</a><a href="#associatedtype.Target-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T></h4></section></summary><div class='docblock'>The resulting type after dereferencing.</div></details><details class="toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#815-818">Source</a><a href="#method.deref" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Deref.html#tymethod.deref" class="fn">deref</a>(&self) -> &<a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T></h4></section></summary><div class='docblock'>Dereferences the value.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Div-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#108">Source</a><a href="#impl-Div-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-5" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#108">Source</a><a href="#associatedtype.Output-5" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Div.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h4></section></summary><div class='docblock'>The resulting type after applying the <code>/</code> operator.</div></details><details class="toggle method-toggle" open><summary><section id="method.div" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#108">Source</a><a href="#method.div" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Div.html#tymethod.div" class="fn">div</a>(self, other: Self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Div.html#associatedtype.Output" title="type core::ops::arith::Div::Output">Output</a></h4></section></summary><div class='docblock'>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26Bound%3C'py,+T%3E%3E-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#797-803">Source</a><a href="#impl-From%3C%26Bound%3C'py,+T%3E%3E-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><&'a <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#800-802">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(instance: &'a <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, T>) -> Self</h4></section></summary><div class="docblock"><p>Create borrow on a Bound</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoPy%3CPy%3CPyAny%3E%3E-for-Borrowed%3C'_,+'_,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#840-846">Source</a><a href="#impl-IntoPy%3CPy%3CPyAny%3E%3E-for-Borrowed%3C'_,+'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="../conversion/trait.IntoPy.html" title="trait pyo3::conversion::IntoPy">IntoPy</a><<a class="struct" href="../struct.Py.html" title="struct pyo3::Py">Py</a><<a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_py" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#843-845">Source</a><a href="#method.into_py" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPy.html#tymethod.into_py" class="fn">into_py</a>(self, py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'_>) -> <a class="type" href="../type.PyObject.html" title="type pyo3::PyObject">PyObject</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.23.0: <code>IntoPy</code> is going to be replaced by <code>IntoPyObject</code>. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.</span></div></span></summary><div class="docblock"><p>Converts <code>Py</code> instance -> PyObject.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoPyObject%3C'py%3E-for-%26Borrowed%3C'a,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#311-319">Source</a><a href="#impl-IntoPyObject%3C'py%3E-for-%26Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="../conversion/trait.IntoPyObject.html" title="trait pyo3::conversion::IntoPyObject">IntoPyObject</a><'py> for &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#312">Source</a><a href="#associatedtype.Target-1" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><div class='docblock'>The Python output type</div></details><details class="toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#313">Source</a><a href="#associatedtype.Output-1" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, <&<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T> as <a class="trait" href="../conversion/trait.IntoPyObject.html" title="trait pyo3::conversion::IntoPyObject">IntoPyObject</a><'py>>::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Target" title="type pyo3::conversion::IntoPyObject::Target">Target</a>></h4></section></summary><div class='docblock'>The smart pointer type to use. <a href="../conversion/trait.IntoPyObject.html#associatedtype.Output">Read more</a></div></details><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#314">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_pyobject-1" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#316-318">Source</a><a href="#method.into_pyobject-1" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPyObject.html#tymethod.into_pyobject" class="fn">into_pyobject</a>(self, _py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Output" title="type pyo3::conversion::IntoPyObject::Output">Output</a>, Self::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Error" title="type pyo3::conversion::IntoPyObject::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoPyObject%3C'py%3E-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#301-309">Source</a><a href="#impl-IntoPyObject%3C'py%3E-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="../conversion/trait.IntoPyObject.html" title="trait pyo3::conversion::IntoPyObject">IntoPyObject</a><'py> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#302">Source</a><a href="#associatedtype.Target" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><div class='docblock'>The Python output type</div></details><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#303">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, <<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T> as <a class="trait" href="../conversion/trait.IntoPyObject.html" title="trait pyo3::conversion::IntoPyObject">IntoPyObject</a><'py>>::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Target" title="type pyo3::conversion::IntoPyObject::Target">Target</a>></h4></section></summary><div class='docblock'>The smart pointer type to use. <a href="../conversion/trait.IntoPyObject.html#associatedtype.Output">Read more</a></div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#304">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="../conversion/trait.IntoPyObject.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_pyobject" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#306-308">Source</a><a href="#method.into_pyobject" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPyObject.html#tymethod.into_pyobject" class="fn">into_pyobject</a>(self, _py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Output" title="type pyo3::conversion::IntoPyObject::Output">Output</a>, Self::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Error" title="type pyo3::conversion::IntoPyObject::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Mul-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#107">Source</a><a href="#impl-Mul-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#107">Source</a><a href="#associatedtype.Output-4" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Mul.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h4></section></summary><div class='docblock'>The resulting type after applying the <code>*</code> operator.</div></details><details class="toggle method-toggle" open><summary><section id="method.mul" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#107">Source</a><a href="#method.mul" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Mul.html#tymethod.mul" class="fn">mul</a>(self, other: Self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Mul.html#associatedtype.Output" title="type core::ops::arith::Mul::Output">Output</a></h4></section></summary><div class='docblock'>Performs the <code>*</code> operation. <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Mul.html#tymethod.mul">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Neg-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#110-117">Source</a><a href="#impl-Neg-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-6" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#111">Source</a><a href="#associatedtype.Output-6" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Neg.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details><details class="toggle method-toggle" open><summary><section id="method.neg" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#112-116">Source</a><a href="#method.neg" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Neg.html#tymethod.neg" class="fn">neg</a>(self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Neg.html#associatedtype.Output" title="type core::ops::arith::Neg::Output">Output</a></h4></section></summary><div class='docblock'>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#282-287">Source</a><a href="#impl-PartialEq%3C%26%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&[<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>></h3><div class="docblock"><p>Compares whether the Python bytes object is equal to the <a href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html" title="primitive u8">u8</a>.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes"><code>PyBytes</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-5" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#284-286">Source</a><a href="#method.eq-5" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&[<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-5" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-5" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26bool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#125-130">Source</a><a href="#impl-PartialEq%3C%26bool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>></h3><div class="docblock"><p>Compare <code>Borrowed<PyBool></code> with <code>&bool</code></p>
|
||
</div></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-1" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#127-129">Source</a><a href="#method.eq-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-1" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26f32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#impl-PartialEq%3C%26f32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-13" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#method.eq-13" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-13" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-13" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26f64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#impl-PartialEq%3C%26f64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-9" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#method.eq-9" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-9" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-9" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%26str%3E-for-Borrowed%3C'_,+'_,+PyString%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#560-565">Source</a><a href="#impl-PartialEq%3C%26str%3E-for-Borrowed%3C'_,+'_,+PyString%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>></h3><div class="docblock"><p>Compares whether the data in the Python string is equal to the given UTF8.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyString.html" title="struct pyo3::types::PyString"><code>PyString</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-17" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#562-564">Source</a><a href="#method.eq-17" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &&<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-17" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-17" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3C%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#272-277">Source</a><a href="#impl-PartialEq%3C%5Bu8%5D%3E-for-Borrowed%3C'_,+'_,+PyBytes%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><[<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>></h3><div class="docblock"><p>Compares whether the Python bytes object is equal to the <a href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html" title="primitive u8">u8</a>.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes"><code>PyBytes</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-4" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#274-276">Source</a><a href="#method.eq-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &[<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-4" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-%26bool" class="impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#141-146">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-%26bool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>>> for &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h3><div class="docblock"><p>Compare <code>&bool</code> with <code>Borrowed<PyBool></code></p>
|
||
</div></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-3" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#143-145">Source</a><a href="#method.eq-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-3" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-bool" class="impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#133-138">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBool%3E%3E-for-bool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>>> for <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h3><div class="docblock"><p>Compare <code>bool</code> with <code>Borrowed<PyBool></code></p>
|
||
</div></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-2" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#135-137">Source</a><a href="#method.eq-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-2" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%26%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#302-307">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%26%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>>> for &[<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]</h3><div class="docblock"><p>Compares whether the Python bytes object is equal to the <a href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html" title="primitive u8">u8</a>.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes"><code>PyBytes</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-7" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#304-306">Source</a><a href="#method.eq-7" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-7" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-7" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#292-297">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyBytes%3E%3E-for-%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>>> for [<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>]</h3><div class="docblock"><p>Compares whether the Python bytes object is equal to the <a href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html" title="primitive u8">u8</a>.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes"><code>PyBytes</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-6" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/bytes.rs.html#294-296">Source</a><a href="#method.eq-6" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBytes.html" title="struct pyo3::types::PyBytes">PyBytes</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-6" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-6" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f32" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>> for &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-15" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#method.eq-15" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-15" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-15" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f64" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-%26f64" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>> for &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-11" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#method.eq-11" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-11" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-11" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f32" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>> for <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-14" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#method.eq-14" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-14" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-14" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f64" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyFloat%3E%3E-for-f64" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>> for <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-10" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#method.eq-10" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-10" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-10" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-%26str" class="impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#580-585">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-%26str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>>> for &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a></h3><div class="docblock"><p>Compares whether the data in the Python string is equal to the given UTF8.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyString.html" title="struct pyo3::types::PyString"><code>PyString</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-19" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#582-584">Source</a><a href="#method.eq-19" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-19" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-19" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-str" class="impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#570-575">Source</a><a href="#impl-PartialEq%3CBorrowed%3C'_,+'_,+PyString%3E%3E-for-str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>>> for <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a></h3><div class="docblock"><p>Compares whether the data in the Python string is equal to the given UTF8.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyString.html" title="struct pyo3::types::PyString"><code>PyString</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-18" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#572-574">Source</a><a href="#method.eq-18" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-18" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-18" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3Cbool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#117-122">Source</a><a href="#impl-PartialEq%3Cbool%3E-for-Borrowed%3C'_,+'_,+PyBool%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyBool.html" title="struct pyo3::types::PyBool">PyBool</a>></h3><div class="docblock"><p>Compare <code>Borrowed<PyBool></code> with <code>bool</code></p>
|
||
</div></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/boolobject.rs.html#119-121">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3Cf32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#impl-PartialEq%3Cf32%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-12" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#293">Source</a><a href="#method.eq-12" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f32.html">f32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-12" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-12" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3Cf64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#impl-PartialEq%3Cf64%3E-for-Borrowed%3C'_,+'_,+PyFloat%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyFloat.html" title="struct pyo3::types::PyFloat">PyFloat</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-8" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/float.rs.html#292">Source</a><a href="#method.eq-8" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-8" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-8" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq%3Cstr%3E-for-Borrowed%3C'_,+'_,+PyString%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#538-555">Source</a><a href="#impl-PartialEq%3Cstr%3E-for-Borrowed%3C'_,+'_,+PyString%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a>> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, <a class="struct" href="../types/struct.PyString.html" title="struct pyo3::types::PyString">PyString</a>></h3><div class="docblock"><p>Compares whether the data in the Python string is equal to the given UTF8.</p>
|
||
</div></section></summary><div class="docblock"><p>In some cases Python equality might be more appropriate; see the note on <a href="../types/struct.PyString.html" title="struct pyo3::types::PyString"><code>PyString</code></a>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq-16" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/string.rs.html#540-554">Source</a><a href="#method.eq-16" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.str.html">str</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne-16" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.85.1/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne-16" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
|
||
and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Sub-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#106">Source</a><a href="#impl-Sub-for-Borrowed%3C'_,+'py,+PyComplex%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#106">Source</a><a href="#associatedtype.Output-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Sub.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyComplex.html" title="struct pyo3::types::PyComplex">PyComplex</a>></h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details><details class="toggle method-toggle" open><summary><section id="method.sub" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/types/complex.rs.html#106">Source</a><a href="#method.sub" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Sub.html#tymethod.sub" class="fn">sub</a>(self, other: Self) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Sub.html#associatedtype.Output" title="type core::ops::arith::Sub::Output">Output</a></h4></section></summary><div class='docblock'>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/1.85.1/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-ToPyObject-for-Borrowed%3C'_,+'_,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#831-837">Source</a><a href="#impl-ToPyObject-for-Borrowed%3C'_,+'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="../conversion/trait.ToPyObject.html" title="trait pyo3::conversion::ToPyObject">ToPyObject</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, T></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.to_object" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#834-836">Source</a><a href="#method.to_object" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.ToPyObject.html#tymethod.to_object" class="fn">to_object</a>(&self, py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'_>) -> <a class="type" href="../type.PyObject.html" title="type pyo3::PyObject">PyObject</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.23.0: <code>ToPyObject</code> is going to be replaced by <code>IntoPyObject</code>. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.</span></div></span></summary><div class="docblock"><p>Converts <code>Py</code> instance -> PyObject.</p>
|
||
</div></details></div></details><section id="impl-Copy-for-Borrowed%3C'_,+'_,+T%3E" class="impl"><a class="src rightside" href="../../src/pyo3/instance.rs.html#828">Source</a><a href="#impl-Copy-for-Borrowed%3C'_,+'_,+T%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, '_, T></h3></section><section id="impl-PyCallArgs%3C'py%3E-for-Borrowed%3C'_,+'py,+PyTuple%3E" class="impl"><a class="src rightside" href="../../src/pyo3/call.rs.html#192-217">Source</a><a href="#impl-PyCallArgs%3C'py%3E-for-Borrowed%3C'_,+'py,+PyTuple%3E" class="anchor">§</a><h3 class="code-header">impl<'py> <a class="trait" href="../call/trait.PyCallArgs.html" title="trait pyo3::call::PyCallArgs">PyCallArgs</a><'py> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'_, 'py, <a class="struct" href="../types/struct.PyTuple.html" title="struct pyo3::types::PyTuple">PyTuple</a>></h3></section></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-Freeze-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section><section id="impl-RefUnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T><div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</div></h3></section><section id="impl-Send-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-Send-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> !<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section><section id="impl-Sync-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-Sync-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> !<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section><section id="impl-Unpin-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-Unpin-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T></h3></section><section id="impl-UnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" class="impl"><a href="#impl-UnwindSafe-for-Borrowed%3C'a,+'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'py, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a><'a, 'py, T><div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.85.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.85.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.85.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.85.1/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#767">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#770">Source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#750-752">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#760">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-IntoPyObjectExt%3C'py%3E-for-T" class="impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#401">Source</a><a href="#impl-IntoPyObjectExt%3C'py%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<'py, T> <a class="trait" href="../conversion/trait.IntoPyObjectExt.html" title="trait pyo3::conversion::IntoPyObjectExt">IntoPyObjectExt</a><'py> for T<div class="where">where
|
||
T: <a class="trait" href="../conversion/trait.IntoPyObject.html" title="trait pyo3::conversion::IntoPyObject">IntoPyObject</a><'py>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into_bound_py_any" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#370-375">Source</a><a href="#method.into_bound_py_any" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPyObjectExt.html#method.into_bound_py_any" class="fn">into_bound_py_any</a>(self, py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>) -> <a class="type" href="../type.PyResult.html" title="type pyo3::PyResult">PyResult</a><<a class="struct" href="../struct.Bound.html" title="struct pyo3::Bound">Bound</a><'py, <a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>>></h4></section></summary><div class='docblock'>Converts <code>self</code> into an owned Python object, dropping type information.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_py_any" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#380-385">Source</a><a href="#method.into_py_any" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPyObjectExt.html#method.into_py_any" class="fn">into_py_any</a>(self, py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>) -> <a class="type" href="../type.PyResult.html" title="type pyo3::PyResult">PyResult</a><<a class="struct" href="../struct.Py.html" title="struct pyo3::Py">Py</a><<a class="struct" href="../types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>>></h4></section></summary><div class='docblock'>Converts <code>self</code> into an owned Python object, dropping type information and unbinding it
|
||
from the <code>'py</code> lifetime.</div></details><details class="toggle method-toggle" open><summary><section id="method.into_pyobject_or_pyerr" class="method trait-impl"><a class="src rightside" href="../../src/pyo3/conversion.rs.html#393-398">Source</a><a href="#method.into_pyobject_or_pyerr" class="anchor">§</a><h4 class="code-header">fn <a href="../conversion/trait.IntoPyObjectExt.html#method.into_pyobject_or_pyerr" class="fn">into_pyobject_or_pyerr</a>(self, py: <a class="struct" href="../marker/struct.Python.html" title="struct pyo3::marker::Python">Python</a><'py>) -> <a class="type" href="../type.PyResult.html" title="type pyo3::PyResult">PyResult</a><Self::<a class="associatedtype" href="../conversion/trait.IntoPyObject.html#associatedtype.Output" title="type pyo3::conversion::IntoPyObject::Output">Output</a>></h4></section></summary><div class='docblock'>Converts <code>self</code> into a Python object. <a href="../conversion/trait.IntoPyObjectExt.html#method.into_pyobject_or_pyerr">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Receiver-for-P" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/ops/deref.rs.html#418-420">Source</a><a href="#impl-Receiver-for-P" class="anchor">§</a><h3 class="code-header">impl<P, T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Receiver.html" title="trait core::ops::deref::Receiver">Receiver</a> for P<div class="where">where
|
||
P: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = T> + ?<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.85.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Target-3" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/ops/deref.rs.html#422">Source</a><a href="#associatedtype.Target-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/ops/deref/trait.Receiver.html#associatedtype.Target" class="associatedtype">Target</a> = T</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>arbitrary_self_types</code>)</span></div></span><div class='docblock'>The target type on which the method may be called.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.85.1/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.85.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#807-809">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#811">Source</a><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#814">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#792-794">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#796">Source</a><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.85.1/src/core/convert/mod.rs.html#799">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.85.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.85.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html> |