pub async fn insert_conditionally<K, V>(
        &self,
        k: &K,
        v: &V,
        key_version: Version,
        offset: i64,
    ) -> Result<Version, TableError>
    where
        K: Serialize + serde::de::DeserializeOwned,
        V: Serialize + serde::de::DeserializeOwned,
    {
        let key = to_vec(k).expect("error during serialization.");
        let val = to_vec(v).expect("error during serialization.");
        self.insert_raw_values(vec![(key, val, key_version)], offset)
            .await
            .map(|versions| versions[0])
    }
/// Conditionally insert a key-value pair into the table map. The Key and Value are serialized to bytes using
/// cbor.
///
/// The insert is performed after checking the key_version passed.
/// Once the update is done the newer version is returned.
/// TableError::BadKeyVersion is returned in case of an incorrect key version.
Conditionally insert a key-value pair into the table map. The Key and Value are serialized to bytes using
cbor.

The insert is performed after checking the key_version passed.
Once the update is done the newer version is returned.
TableError::BadKeyVersion is returned in case of an incorrect key version.
Conditionally insert a key - value pair into the table map . The Key and Value are serialized to bytes using cbor . The insert is performed after checking the key_version passed . Once the update is done the newer version is returned . TableError :: BadKeyVersion is returned in case of an incorrect key version .
pub async fn insert_conditionally<K, V>(
        &self,
        k: &K,
        v: &V,
        key_version: Version,
        offset: i64,
    ) -> Result<Version, TableError>
    where
        K: Serialize + serde::de::DeserializeOwned,
        V: Serialize + serde::de::DeserializeOwned,
    {
        let key = to_vec(k).expect("error during serialization.");
        let val = to_vec(v).expect("error during serialization.");
        self.insert_raw_values(vec![(key, val, key_version)], offset)
            .await
            .map(|versions| versions[0])
    }
pub async fn insert_conditionally < K , V > ( & self , k : & K , v : & V , key_version : Version , offset : i64 , ) -> Result < Version , TableError > where K : Serialize + serde :: de :: DeserializeOwned , V : Serialize + serde :: de :: DeserializeOwned , { let key = to_vec ( k ) . expect ( " " ) ; let val = to_vec ( v ) . expect ( " " ) ; self . insert_raw_values ( vec ! [ ( key val key_version ) ] , offset ) . await . map ( | versions | versions [ 0 ] ) }
Conditionally insert a key-value pair into the table map.
Conditionally insert a key - value pair into the table map .
&self
k
&K
v
&V
key_version
Version
offset
i64
&self
k
&K
v
&V
key_version
Version
offset
i64