pub struct LowCardinality;Expand description
A strategy for encoding values that are often repeated.
This can be shockingly efficient when there are just a few values for e.g. a string field.
Trait Implementations§
Source§impl Clone for LowCardinality
impl Clone for LowCardinality
Source§fn clone(&self) -> LowCardinality
fn clone(&self) -> LowCardinality
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LowCardinality
impl Debug for LowCardinality
Source§impl Default for LowCardinality
impl Default for LowCardinality
Source§fn default() -> LowCardinality
fn default() -> LowCardinality
Returns the “default value” for a type. Read more
Source§impl<const N: usize, T: Encode + Clone + Hash + Eq> EncodingStrategy<[T; N]> for LowCardinality
impl<const N: usize, T: Encode + Clone + Hash + Eq> EncodingStrategy<[T; N]> for LowCardinality
Source§type Context = CacheContext<[T; N]>
type Context = CacheContext<[T; N]>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &[T; N],
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &[T; N], writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl<T> EncodingStrategy<Option<T>> for LowCardinalitywhere
LowCardinality: EncodingStrategy<T>,
impl<T> EncodingStrategy<Option<T>> for LowCardinalitywhere
LowCardinality: EncodingStrategy<T>,
Source§type Context = LowContext<<LowCardinality as EncodingStrategy<T>>::Context>
type Context = LowContext<<LowCardinality as EncodingStrategy<T>>::Context>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &Option<T>,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &Option<T>, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl<T> EncodingStrategy<Option<T>> for LowCardinalitywhere
LowCardinality: EncodingStrategy<T>,
impl<T> EncodingStrategy<Option<T>> for LowCardinalitywhere
LowCardinality: EncodingStrategy<T>,
Source§type Context = LowContext<<LowCardinality as EncodingStrategy<T>>::Context>
type Context = LowContext<<LowCardinality as EncodingStrategy<T>>::Context>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§impl EncodingStrategy<String> for LowCardinality
impl EncodingStrategy<String> for LowCardinality
Source§type Context = CacheContext<String>
type Context = CacheContext<String>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &String,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &String, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<String> for LowCardinality
impl EncodingStrategy<String> for LowCardinality
Source§impl<T> EncodingStrategy<Vec<T>> for LowCardinality
impl<T> EncodingStrategy<Vec<T>> for LowCardinality
Source§type Context = (<usize as Encode>::Context, <LowCardinality as EncodingStrategy<T>>::Context)
type Context = (<usize as Encode>::Context, <LowCardinality as EncodingStrategy<T>>::Context)
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &Vec<T>,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &Vec<T>, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl<T> EncodingStrategy<Vec<T>> for LowCardinality
impl<T> EncodingStrategy<Vec<T>> for LowCardinality
Source§type Context = (<usize as Encode>::Context, <LowCardinality as EncodingStrategy<T>>::Context)
type Context = (<usize as Encode>::Context, <LowCardinality as EncodingStrategy<T>>::Context)
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§impl EncodingStrategy<Vec<u8>> for LowCardinality
impl EncodingStrategy<Vec<u8>> for LowCardinality
Source§type Context = CacheContext<Vec<u8>>
type Context = CacheContext<Vec<u8>>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &Vec<u8>,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &Vec<u8>, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<Vec<u8>> for LowCardinality
impl EncodingStrategy<Vec<u8>> for LowCardinality
Source§impl EncodingStrategy<u64> for LowCardinality
impl EncodingStrategy<u64> for LowCardinality
Source§type Context = CacheContext<u64>
type Context = CacheContext<u64>
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &u64,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &u64, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<u64> for LowCardinality
impl EncodingStrategy<u64> for LowCardinality
Source§impl Hash for LowCardinality
impl Hash for LowCardinality
Source§impl Ord for LowCardinality
impl Ord for LowCardinality
Source§fn cmp(&self, other: &LowCardinality) -> Ordering
fn cmp(&self, other: &LowCardinality) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LowCardinality
impl PartialEq for LowCardinality
Source§impl PartialOrd for LowCardinality
impl PartialOrd for LowCardinality
impl Copy for LowCardinality
impl Eq for LowCardinality
impl StructuralPartialEq for LowCardinality
Auto Trait Implementations§
impl Freeze for LowCardinality
impl RefUnwindSafe for LowCardinality
impl Send for LowCardinality
impl Sync for LowCardinality
impl Unpin for LowCardinality
impl UnsafeUnpin for LowCardinality
impl UnwindSafe for LowCardinality
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more