Files
google_speech_rs/docs/pyo3/trait.BoundObject.html
2025-04-02 13:41:38 +00:00

20 lines
12 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="Owned or borrowed gil-bound Python smart pointer"><title>BoundObject in pyo3 - 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 trait"><!--[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="#">Bound<wbr>Object</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Any" title="Any">Any</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_borrowed" title="as_borrowed">as_borrowed</a></li><li><a href="#tymethod.as_ptr" title="as_ptr">as_ptr</a></li><li><a href="#tymethod.into_any" title="into_any">into_any</a></li><li><a href="#tymethod.into_bound" title="into_bound">into_bound</a></li><li><a href="#tymethod.into_ptr" title="into_ptr">into_ptr</a></li><li><a href="#tymethod.unbind" title="unbind">unbind</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate pyo3</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></span><h1>Trait <span class="trait">BoundObject</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#24-39">Source</a> </span></div><pre class="rust item-decl"><code>pub trait BoundObject&lt;'py, T&gt;: Sealed {
type <a href="#associatedtype.Any" class="associatedtype">Any</a>: <a class="trait" href="trait.BoundObject.html" title="trait pyo3::BoundObject">BoundObject</a>&lt;'py, <a class="struct" href="types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>&gt;;
// Required methods
fn <a href="#tymethod.as_borrowed" class="fn">as_borrowed</a>(&amp;self) -&gt; <a class="struct" href="struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a>&lt;'_, 'py, T&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.into_bound" class="fn">into_bound</a>(self) -&gt; <a class="struct" href="struct.Bound.html" title="struct pyo3::Bound">Bound</a>&lt;'py, T&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.into_any" class="fn">into_any</a>(self) -&gt; Self::<a class="associatedtype" href="trait.BoundObject.html#associatedtype.Any" title="type pyo3::BoundObject::Any">Any</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.into_ptr" class="fn">into_ptr</a>(self) -&gt; <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>;
<span class="item-spacer"></span> fn <a href="#tymethod.as_ptr" class="fn">as_ptr</a>(&amp;self) -&gt; <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>;
<span class="item-spacer"></span> fn <a href="#tymethod.unbind" class="fn">unbind</a>(self) -&gt; <a class="struct" href="struct.Py.html" title="struct pyo3::Py">Py</a>&lt;T&gt;;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Owned or borrowed gil-bound Python smart pointer</p>
<p>This is implemented for <a href="struct.Bound.html" title="struct pyo3::Bound"><code>Bound</code></a> and <a href="struct.Borrowed.html" title="struct pyo3::Borrowed"><code>Borrowed</code></a>.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Any" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#26">Source</a><h4 class="code-header">type <a href="#associatedtype.Any" class="associatedtype">Any</a>: <a class="trait" href="trait.BoundObject.html" title="trait pyo3::BoundObject">BoundObject</a>&lt;'py, <a class="struct" href="types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>&gt;</h4></section></summary><div class="docblock"><p>Type erased version of <code>Self</code></p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.as_borrowed" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#28">Source</a><h4 class="code-header">fn <a href="#tymethod.as_borrowed" class="fn">as_borrowed</a>(&amp;self) -&gt; <a class="struct" href="struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a>&lt;'_, 'py, T&gt;</h4></section></summary><div class="docblock"><p>Borrow this smart pointer.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.into_bound" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#30">Source</a><h4 class="code-header">fn <a href="#tymethod.into_bound" class="fn">into_bound</a>(self) -&gt; <a class="struct" href="struct.Bound.html" title="struct pyo3::Bound">Bound</a>&lt;'py, T&gt;</h4></section></summary><div class="docblock"><p>Turns this smart pointer into an owned [<code>Bound&lt;'py, T&gt;</code>]</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.into_any" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#32">Source</a><h4 class="code-header">fn <a href="#tymethod.into_any" class="fn">into_any</a>(self) -&gt; Self::<a class="associatedtype" href="trait.BoundObject.html#associatedtype.Any" title="type pyo3::BoundObject::Any">Any</a></h4></section></summary><div class="docblock"><p>Upcast the target type of this smart pointer</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.into_ptr" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#34">Source</a><h4 class="code-header">fn <a href="#tymethod.into_ptr" class="fn">into_ptr</a>(self) -&gt; <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>Turn this smart pointer into a strong reference pointer</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.as_ptr" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#36">Source</a><h4 class="code-header">fn <a href="#tymethod.as_ptr" class="fn">as_ptr</a>(&amp;self) -&gt; <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>Turn this smart pointer into a borrowed reference pointer</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.unbind" class="method"><a class="src rightside" href="../src/pyo3/instance.rs.html#38">Source</a><h4 class="code-header">fn <a href="#tymethod.unbind" class="fn">unbind</a>(self) -&gt; <a class="struct" href="struct.Py.html" title="struct pyo3::Py">Py</a>&lt;T&gt;</h4></section></summary><div class="docblock"><p>Turn this smart pointer into an owned <a href="struct.Py.html" title="struct pyo3::Py"><code>Py&lt;T&gt;</code></a></p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><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&lt;'a, 'py, T&gt; <a class="trait" href="trait.BoundObject.html" title="trait pyo3::BoundObject">BoundObject</a>&lt;'py, T&gt; for <a class="struct" href="struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a>&lt;'a, 'py, T&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Any-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/pyo3/instance.rs.html#849">Source</a><a href="#associatedtype.Any-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Any" class="associatedtype">Any</a> = <a class="struct" href="struct.Borrowed.html" title="struct pyo3::Borrowed">Borrowed</a>&lt;'a, 'py, <a class="struct" href="types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BoundObject%3C'py,+T%3E-for-Bound%3C'py,+T%3E" class="impl"><a class="src rightside" href="../src/pyo3/instance.rs.html#623-649">Source</a><a href="#impl-BoundObject%3C'py,+T%3E-for-Bound%3C'py,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'py, T&gt; <a class="trait" href="trait.BoundObject.html" title="trait pyo3::BoundObject">BoundObject</a>&lt;'py, T&gt; for <a class="struct" href="struct.Bound.html" title="struct pyo3::Bound">Bound</a>&lt;'py, T&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Any-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/pyo3/instance.rs.html#624">Source</a><a href="#associatedtype.Any-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Any" class="associatedtype">Any</a> = <a class="struct" href="struct.Bound.html" title="struct pyo3::Bound">Bound</a>&lt;'py, <a class="struct" href="types/struct.PyAny.html" title="struct pyo3::types::PyAny">PyAny</a>&gt;</h4></section></div></details></div><script src="../trait.impl/pyo3/instance/trait.BoundObject.js" async></script></section></div></main></body></html>