mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 22:02:56 +00:00
59 lines
18 KiB
HTML
59 lines
18 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="API documentation for the Rust `PrimaryKeyCodec` trait in crate `mito_codec`."><title>PrimaryKeyCodec in mito_codec::row_converter - 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="mito_codec" 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="#">PrimaryKeyCodec</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../mito_codec/index.html">mito_<wbr>codec</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="#">Primary<wbr>KeyCodec</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.decode" title="decode">decode</a></li><li><a href="#tymethod.decode_leftmost" title="decode_leftmost">decode_leftmost</a></li><li><a href="#tymethod.encode_key_value" title="encode_key_value">encode_key_value</a></li><li><a href="#tymethod.encode_value_refs" title="encode_value_refs">encode_value_refs</a></li><li><a href="#tymethod.encode_values" title="encode_values">encode_values</a></li><li><a href="#tymethod.encoding" title="encoding">encoding</a></li><li><a href="#tymethod.num_fields" title="num_fields">num_fields</a></li><li><a href="#tymethod.primary_key_filter" title="primary_key_filter">primary_key_filter</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.estimated_size" title="estimated_size">estimated_size</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In mito_<wbr>codec::<wbr>row_<wbr>converter</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">mito_codec</a>::<wbr><a href="index.html">row_converter</a></div><h1>Trait <span class="trait">Primary<wbr>KeyCodec</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/mito_codec/row_converter.rs.html#101-140">Source</a> </span></div><pre class="rust item-decl"><code>pub trait PrimaryKeyCodec:
|
|
<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>
|
|
+ <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>
|
|
+ <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
|
|
// Required methods
|
|
fn <a href="#tymethod.encode_key_value" class="fn">encode_key_value</a>(
|
|
&self,
|
|
key_value: &<a class="struct" href="../key_values/struct.KeyValue.html" title="struct mito_codec::key_values::KeyValue">KeyValue</a><'_>,
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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="#tymethod.encode_values" class="fn">encode_values</a>(
|
|
&self,
|
|
values: &[(ColumnId, Value)],
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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="#tymethod.encode_value_refs" class="fn">encode_value_refs</a>(
|
|
&self,
|
|
values: &[(ColumnId, ValueRef<'_>)],
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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="#tymethod.num_fields" class="fn">num_fields</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.primary_key_filter" class="fn">primary_key_filter</a>(
|
|
&self,
|
|
metadata: &RegionMetadataRef,
|
|
filters: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><SimpleFilterEvaluator>>,
|
|
) -> <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="trait.PrimaryKeyFilter.html" title="trait mito_codec::row_converter::PrimaryKeyFilter">PrimaryKeyFilter</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.encoding" class="fn">encoding</a>(&self) -> PrimaryKeyEncoding;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.decode" class="fn">decode</a>(&self, bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::error::Result">Result</a><<a class="enum" href="enum.CompositeValues.html" title="enum mito_codec::row_converter::CompositeValues">CompositeValues</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.decode_leftmost" class="fn">decode_leftmost</a>(&self, bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Value>>;
|
|
|
|
// Provided method
|
|
fn <a href="#method.estimated_size" class="fn">estimated_size</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> { ... }
|
|
}</code></pre><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.encode_key_value" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#103">Source</a><h4 class="code-header">fn <a href="#tymethod.encode_key_value" class="fn">encode_key_value</a>(
|
|
&self,
|
|
key_value: &<a class="struct" href="../key_values/struct.KeyValue.html" title="struct mito_codec::key_values::KeyValue">KeyValue</a><'_>,
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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>Encodes a key value to bytes.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.encode_values" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#106">Source</a><h4 class="code-header">fn <a href="#tymethod.encode_values" class="fn">encode_values</a>(
|
|
&self,
|
|
values: &[(ColumnId, Value)],
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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>Encodes values to bytes.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.encode_value_refs" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#109-113">Source</a><h4 class="code-header">fn <a href="#tymethod.encode_value_refs" class="fn">encode_value_refs</a>(
|
|
&self,
|
|
values: &[(ColumnId, ValueRef<'_>)],
|
|
buffer: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
|
) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::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>Encodes values to bytes.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.num_fields" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#116">Source</a><h4 class="code-header">fn <a href="#tymethod.num_fields" class="fn">num_fields</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Returns the number of fields in the primary key.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.primary_key_filter" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#119-123">Source</a><h4 class="code-header">fn <a href="#tymethod.primary_key_filter" class="fn">primary_key_filter</a>(
|
|
&self,
|
|
metadata: &RegionMetadataRef,
|
|
filters: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><SimpleFilterEvaluator>>,
|
|
) -> <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="trait.PrimaryKeyFilter.html" title="trait mito_codec::row_converter::PrimaryKeyFilter">PrimaryKeyFilter</a>></h4></section></summary><div class="docblock"><p>Returns a primary key filter factory.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.encoding" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#131">Source</a><h4 class="code-header">fn <a href="#tymethod.encoding" class="fn">encoding</a>(&self) -> PrimaryKeyEncoding</h4></section></summary><div class="docblock"><p>Returns the encoding type of the primary key.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.decode" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#136">Source</a><h4 class="code-header">fn <a href="#tymethod.decode" class="fn">decode</a>(&self, bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::error::Result">Result</a><<a class="enum" href="enum.CompositeValues.html" title="enum mito_codec::row_converter::CompositeValues">CompositeValues</a>></h4></section></summary><div class="docblock"><p>Decodes the primary key from the given bytes.</p>
|
|
<p>Returns a <a href="enum.CompositeValues.html" title="enum mito_codec::row_converter::CompositeValues"><code>CompositeValues</code></a> that follows the primary key ordering.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.decode_leftmost" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#139">Source</a><h4 class="code-header">fn <a href="#tymethod.decode_leftmost" class="fn">decode_leftmost</a>(&self, bytes: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="type" href="../error/type.Result.html" title="type mito_codec::error::Result">Result</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Value>></h4></section></summary><div class="docblock"><p>Decode the leftmost value from bytes.</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.estimated_size" class="method"><a class="src rightside" href="../../src/mito_codec/row_converter.rs.html#126-128">Source</a><h4 class="code-header">fn <a href="#method.estimated_size" class="fn">estimated_size</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Returns the estimated size of the primary key.</p>
|
|
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-PrimaryKeyCodec-for-DensePrimaryKeyCodec" class="impl"><a class="src rightside" href="../../src/mito_codec/row_converter/dense.rs.html#495-546">Source</a><a href="#impl-PrimaryKeyCodec-for-DensePrimaryKeyCodec" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.PrimaryKeyCodec.html" title="trait mito_codec::row_converter::PrimaryKeyCodec">PrimaryKeyCodec</a> for <a class="struct" href="dense/struct.DensePrimaryKeyCodec.html" title="struct mito_codec::row_converter::dense::DensePrimaryKeyCodec">DensePrimaryKeyCodec</a></h3></section><section id="impl-PrimaryKeyCodec-for-SparsePrimaryKeyCodec" class="impl"><a class="src rightside" href="../../src/mito_codec/row_converter/sparse.rs.html#301-352">Source</a><a href="#impl-PrimaryKeyCodec-for-SparsePrimaryKeyCodec" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.PrimaryKeyCodec.html" title="trait mito_codec::row_converter::PrimaryKeyCodec">PrimaryKeyCodec</a> for <a class="struct" href="sparse/struct.SparsePrimaryKeyCodec.html" title="struct mito_codec::row_converter::sparse::SparsePrimaryKeyCodec">SparsePrimaryKeyCodec</a></h3></section></div><script src="../../trait.impl/mito_codec/row_converter/trait.PrimaryKeyCodec.js" async></script></section></div></main></body></html> |