pub struct ContextEntry {
pub key: String,
pub value: Value,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub expires_at: Option<DateTime<Utc>>,
pub git_commit: Option<String>,
pub file_path: Option<String>,
pub file_mtime: Option<i64>,
pub metadata: HashMap<String, String>,
}Expand description
A context entry in the store.
Fields§
§key: StringThe full key (including namespace prefix).
value: ValueThe value (JSON).
created_at: DateTime<Utc>When the entry was created.
updated_at: DateTime<Utc>When the entry was last updated.
expires_at: Option<DateTime<Utc>>When the entry expires (optional TTL).
git_commit: Option<String>Git commit hash when entry was created (for invalidation).
file_path: Option<String>File path this entry relates to (for file-level context).
file_mtime: Option<i64>File modification time when entry was created.
metadata: HashMap<String, String>Custom metadata.
Implementations§
Source§impl ContextEntry
impl ContextEntry
Sourcepub fn with_git_commit(self, commit: impl Into<String>) -> Self
pub fn with_git_commit(self, commit: impl Into<String>) -> Self
Set git commit for invalidation.
Sourcepub fn with_file_info(self, path: impl Into<String>, mtime: i64) -> Self
pub fn with_file_info(self, path: impl Into<String>, mtime: i64) -> Self
Set file path and mtime for invalidation.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this entry has expired.
Trait Implementations§
Source§impl Clone for ContextEntry
impl Clone for ContextEntry
Source§fn clone(&self) -> ContextEntry
fn clone(&self) -> ContextEntry
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 ContextEntry
impl Debug for ContextEntry
Source§impl<'de> Deserialize<'de> for ContextEntry
impl<'de> Deserialize<'de> for ContextEntry
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 ContextEntry
impl RefUnwindSafe for ContextEntry
impl Send for ContextEntry
impl Sync for ContextEntry
impl Unpin for ContextEntry
impl UnwindSafe for ContextEntry
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