Skip to main content

KV

Struct KV 

Source
pub struct KV {
Show 23 fields pub key1: String, pub key2: String, pub string_val: String, pub int_val: i64, pub small_int: i16, pub unsigned_val: u32, pub float_val: f32, pub double_val: f64, pub boolean_val: bool, pub opt_string: Option<String>, pub opt_int: Option<i64>, pub opt_float: Option<f64>, pub opt_bool: Option<bool>, pub uuid: Uuid, pub opt_uuid: Option<Uuid>, pub fixed_bytes: [u8; 16], pub numbers: [i32; 4], pub tags: Vec<String>, pub scores: Vec<i32>, pub floats: Option<Vec<f64>>, pub shared_strings: Arc<Vec<String>>, pub metadata: BTreeMap<String, String>, pub counters: Option<BTreeMap<String, i64>>,
}

Fields§

§key1: String§key2: String§string_val: String§int_val: i64§small_int: i16§unsigned_val: u32§float_val: f32§double_val: f64§boolean_val: bool§opt_string: Option<String>§opt_int: Option<i64>§opt_float: Option<f64>§opt_bool: Option<bool>§uuid: Uuid§opt_uuid: Option<Uuid>§fixed_bytes: [u8; 16]§numbers: [i32; 4]§tags: Vec<String>§scores: Vec<i32>§floats: Option<Vec<f64>>§shared_strings: Arc<Vec<String>>§metadata: BTreeMap<String, String>§counters: Option<BTreeMap<String, i64>>

Trait Implementations§

Source§

impl Clone for KV

Source§

fn clone(&self) -> KV

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KV

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Entity for KV

Source§

type PrimaryKey<'a> = (&'a String, &'a String)

Primary key type. A tuple of field types (or single type) forming the PK.
Source§

fn table() -> &'static TableRef

Table reference matching the #[tank(...)] attributes.
Source§

fn columns() -> &'static [ColumnDef]

All column definitions in declaration order.
Source§

fn primary_key_def() -> &'static [&'static ColumnDef]

Primary key column definitions. Empty if no PK defined.
Source§

fn primary_key<'a>(&'a self) -> Self::PrimaryKey<'a>

Extract PK value(s) from self.
Source§

fn primary_key_expr(&self) -> impl Expression

Build an expression matching the PK of self.
Source§

fn unique_defs() -> impl ExactSizeIterator<Item = impl ExactSizeIterator<Item = &'static ColumnDef>>

Unique constraint definitions.
Source§

fn row_values(&self) -> RowValues

Full row representation including all persisted columns.
Source§

fn from_row(row: Row) -> Result<Self>

Reconstruct Self from a labeled row. Read more
Source§

fn row(&self) -> Row

Full row representation with column labels.
Source§

fn create_table( executor: &mut impl Executor, if_not_exists: bool, create_schema: bool, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Create table (and optional schema). Read more
Source§

fn drop_table( executor: &mut impl Executor, if_exists: bool, drop_schema: bool, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Drop the table (and optional schema). Read more
Source§

fn insert_one( executor: &mut impl Executor, entity: &impl Entity, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send

Insert a single entity.
Source§

fn insert_many<'a, It>( executor: &mut impl Executor, items: It, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
where Self: Sized + 'a, It: IntoIterator<Item = &'a Self> + Send, <It as IntoIterator>::IntoIter: Send,

Bulk insert entities.
Source§

fn prepare_find<Exec>( executor: &mut Exec, condition: impl Expression, limit: Option<u32>, ) -> impl Future<Output = Result<Query<<Exec as Executor>::Driver>, Error>> + Send
where Exec: Executor,

Prepare (but do not yet run) a SQL select query. Read more
Source§

fn find_one( executor: &mut impl Executor, condition: impl Expression, ) -> impl Future<Output = Result<Option<Self>, Error>> + Send
where Self: Sized,

Finds the first entity matching a condition expression. Read more
Source§

fn find_many( executor: &mut impl Executor, condition: impl Expression, limit: Option<u32>, ) -> impl Stream<Item = Result<Self, Error>> + Send
where Self: Sized,

Streams entities matching a condition. Read more
Source§

fn delete_many( executor: &mut impl Executor, condition: impl Expression, ) -> impl Future<Output = Result<RowsAffected, Error>> + Send
where Self: Sized,

Deletes all entities matching a condition. Read more
Source§

fn save( &self, executor: &mut impl Executor, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Saves the entity (insert or update if available) based on primary key presence. Read more
Source§

fn delete( &self, executor: &mut impl Executor, ) -> impl Future<Output = Result<(), Error>> + Send
where Self: Sized,

Deletes this entity instance via its primary key. Read more
Source§

impl KVColumnTrait for KV

Source§

impl PartialEq for KV

Source§

fn eq(&self, other: &KV) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for KV

Auto Trait Implementations§

§

impl Freeze for KV

§

impl RefUnwindSafe for KV

§

impl Send for KV

§

impl Sync for KV

§

impl Unpin for KV

§

impl UnsafeUnpin for KV

§

impl UnwindSafe for KV

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<E> Dataset for E
where E: Entity,

Source§

fn qualified_columns() -> bool
where E: Sized,

Indicates whether column names should be fully qualified with schema and table name.

For entities this returns false to keep queries concise, for joins it returns true.

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Writes the table reference into the out string.

Source§

fn table_ref(&self) -> TableRef

Returns the primary table reference for this dataset.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.