mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
62 lines
22 KiB
HTML
62 lines
22 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 `Procedure` represents an operation or a set of operations to be performed step-by-step."><title>Procedure in common_procedure::procedure - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="common_procedure" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.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]--><rustdoc-topbar><h2><a href="#">Procedure</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../common_procedure/index.html">common_<wbr>procedure</a><span class="version">1.0.0-beta.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Procedure</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.dump" title="dump">dump</a></li><li><a href="#tymethod.execute" title="execute">execute</a></li><li><a href="#tymethod.lock_key" title="lock_key">lock_key</a></li><li><a href="#tymethod.type_name" title="type_name">type_name</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.poison_keys" title="poison_keys">poison_keys</a></li><li><a href="#method.recover" title="recover">recover</a></li><li><a href="#method.rollback" title="rollback">rollback</a></li><li><a href="#method.rollback_supported" title="rollback_supported">rollback_supported</a></li><li><a href="#method.user_metadata" title="user_metadata">user_metadata</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Procedure-for-Box%3CT%3E" title="Box<T>">Box<T></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>procedure::<wbr>procedure</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">common_procedure</a>::<wbr><a href="index.html">procedure</a></div><h1>Trait <span class="trait">Procedure</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/common_procedure/procedure.rs.html#182-223">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Procedure: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
|
|
// Required methods
|
|
fn <a href="#tymethod.type_name" class="fn">type_name</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.execute" class="fn">execute</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
ctx: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="enum" href="../enum.Status.html" title="enum common_procedure::Status">Status</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>>
|
|
<span class="where">where Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait</span>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.dump" class="fn">dump</a>(&self) -> <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.lock_key" class="fn">lock_key</a>(&self) -> <a class="struct" href="../struct.LockKey.html" title="struct common_procedure::LockKey">LockKey</a>;
|
|
|
|
// Provided methods
|
|
fn <a href="#method.rollback" class="fn">rollback</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
_: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>>
|
|
<span class="where">where Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait</span> { ... }
|
|
<span class="item-spacer"></span> fn <a href="#method.rollback_supported" class="fn">rollback_supported</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
|
<span class="item-spacer"></span> fn <a href="#method.recover" class="fn">recover</a>(&mut self) -> <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
|
<span class="item-spacer"></span> fn <a href="#method.poison_keys" class="fn">poison_keys</a>(&self) -> <a class="struct" href="../struct.PoisonKeys.html" title="struct common_procedure::PoisonKeys">PoisonKeys</a> { ... }
|
|
<span class="item-spacer"></span> fn <a href="#method.user_metadata" class="fn">user_metadata</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.UserMetadata.html" title="struct common_procedure::UserMetadata">UserMetadata</a>> { ... }
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>Procedure</code> represents an operation or a set of operations to be performed step-by-step.</p>
|
|
</div></details><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.type_name" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#184">Source</a><h4 class="code-header">fn <a href="#tymethod.type_name" class="fn">type_name</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Type name of the procedure.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.execute" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#189">Source</a><h4 class="code-header">fn <a href="#tymethod.execute" class="fn">execute</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
ctx: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="enum" href="../enum.Status.html" title="enum common_procedure::Status">Status</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
|
Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Execute the procedure.</p>
|
|
<p>The implementation must be idempotent.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.dump" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#204">Source</a><h4 class="code-header">fn <a href="#tymethod.dump" class="fn">dump</a>(&self) -> <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>Dump the state of the procedure to a string.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.lock_key" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#212">Source</a><h4 class="code-header">fn <a href="#tymethod.lock_key" class="fn">lock_key</a>(&self) -> <a class="struct" href="../struct.LockKey.html" title="struct common_procedure::LockKey">LockKey</a></h4></section></summary><div class="docblock"><p>Returns the <a href="../struct.LockKey.html" title="struct common_procedure::LockKey">LockKey</a> that this procedure needs to acquire.</p>
|
|
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.rollback" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#194-196">Source</a><h4 class="code-header">fn <a href="#method.rollback" class="fn">rollback</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
_: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
|
Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Rollback the failed procedure.</p>
|
|
<p>The implementation must be idempotent.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.rollback_supported" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#199-201">Source</a><h4 class="code-header">fn <a href="#method.rollback_supported" class="fn">rollback_supported</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Indicates whether it supports rolling back the procedure.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.recover" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#207-209">Source</a><h4 class="code-header">fn <a href="#method.recover" class="fn">recover</a>(&mut self) -> <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>The hook is called after the procedure recovery.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.poison_keys" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#215-217">Source</a><h4 class="code-header">fn <a href="#method.poison_keys" class="fn">poison_keys</a>(&self) -> <a class="struct" href="../struct.PoisonKeys.html" title="struct common_procedure::PoisonKeys">PoisonKeys</a></h4></section></summary><div class="docblock"><p>Returns the <a href="../struct.PoisonKeys.html" title="struct common_procedure::PoisonKeys">PoisonKeys</a> that may cause this procedure to become poisoned during execution.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.user_metadata" class="method"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#220-222">Source</a><h4 class="code-header">fn <a href="#method.user_metadata" class="fn">user_metadata</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../struct.UserMetadata.html" title="struct common_procedure::UserMetadata">UserMetadata</a>></h4></section></summary><div class="docblock"><p>Returns the user metadata of the procedure. If the metadata contains the eventable object, you can use <a href="../struct.UserMetadata.html#method.to_event" title="method common_procedure::UserMetadata::to_event">UserMetadata::to_event</a> to get the event and emit it to the event recorder.</p>
|
|
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Procedure-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#244-272">Source</a><a href="#impl-Procedure-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T: <a class="trait" href="../trait.Procedure.html" title="trait common_procedure::Procedure">Procedure</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="../trait.Procedure.html" title="trait common_procedure::Procedure">Procedure</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T></h3></section></summary><div class="impl-items"><section id="method.type_name" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#245-247">Source</a><a href="#method.type_name" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.type_name" class="fn">type_name</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section><section id="method.execute" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#249-251">Source</a><a href="#method.execute" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.execute" class="fn">execute</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
ctx: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="enum" href="../enum.Status.html" title="enum common_procedure::Status">Status</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
|
Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait,</div></h4></section><section id="method.rollback-1" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#253-255">Source</a><a href="#method.rollback-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.rollback" class="fn">rollback</a><'life0, 'life1, 'async_trait>(
|
|
&'life0 mut self,
|
|
ctx: &'life1 <a class="struct" href="../struct.Context.html" title="struct common_procedure::Context">Context</a>,
|
|
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait>><div class="where">where
|
|
Self: 'async_trait,
|
|
'life0: 'async_trait,
|
|
'life1: 'async_trait,</div></h4></section><section id="method.rollback_supported-1" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#257-259">Source</a><a href="#method.rollback_supported-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.rollback_supported" class="fn">rollback_supported</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section><section id="method.dump" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#261-263">Source</a><a href="#method.dump" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.dump" class="fn">dump</a>(&self) -> <a class="type" href="../error/type.Result.html" title="type common_procedure::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section><section id="method.lock_key" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#265-267">Source</a><a href="#method.lock_key" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.lock_key" class="fn">lock_key</a>(&self) -> <a class="struct" href="../struct.LockKey.html" title="struct common_procedure::LockKey">LockKey</a></h4></section><section id="method.poison_keys-1" class="method trait-impl"><a class="src rightside" href="../../src/common_procedure/procedure.rs.html#269-271">Source</a><a href="#method.poison_keys-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.poison_keys" class="fn">poison_keys</a>(&self) -> <a class="struct" href="../struct.PoisonKeys.html" title="struct common_procedure::PoisonKeys">PoisonKeys</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/common_procedure/procedure/trait.Procedure.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html> |