pub struct Record {
pub fields: HashMap<String, FieldType>,
}
Expand description
A record in ekoDB
Fields§
§fields: HashMap<String, FieldType>
Record fields
Implementations§
Source§impl Record
impl Record
Sourcepub fn insert(&mut self, key: impl Into<String>, value: impl Into<FieldType>)
pub fn insert(&mut self, key: impl Into<String>, value: impl Into<FieldType>)
Insert a field into the record
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Check if a field exists
Sourcepub fn with_ttl(self, duration: impl Into<String>) -> Self
pub fn with_ttl(self, duration: impl Into<String>) -> Self
Set TTL duration for this record
Duration format: “30s”, “5m”, “1h”, “1d”
Sourcepub fn with_ttl_update_on_access(
self,
duration: impl Into<String>,
update_on_access: bool,
) -> Self
pub fn with_ttl_update_on_access( self, duration: impl Into<String>, update_on_access: bool, ) -> Self
Set TTL with update-on-access behavior
If true, TTL resets when the record is accessed
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Record
impl<'de> Deserialize<'de> for Record
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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