pub struct RecordCache { /* private fields */ }Expand description
Record-level cache for individual SObject records
Implementations§
Source§impl RecordCache
impl RecordCache
Sourcepub fn new(config: CacheConfig) -> Self
pub fn new(config: CacheConfig) -> Self
Create a new record cache
Sourcepub async fn get<T>(&self, sobject: &str, id: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub async fn get<T>(&self, sobject: &str, id: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
Get cached record
Sourcepub async fn set<T>(&self, sobject: &str, id: &str, data: T) -> SfResult<()>where
T: Serialize,
pub async fn set<T>(&self, sobject: &str, id: &str, data: T) -> SfResult<()>where
T: Serialize,
Store record in cache
Sourcepub async fn invalidate(&self, sobject: &str, id: &str)
pub async fn invalidate(&self, sobject: &str, id: &str)
Invalidate cached record
Sourcepub async fn invalidate_sobject(&self, sobject: &str)
pub async fn invalidate_sobject(&self, sobject: &str)
Invalidate all records of a given SObject type
Auto Trait Implementations§
impl Freeze for RecordCache
impl !RefUnwindSafe for RecordCache
impl Send for RecordCache
impl Sync for RecordCache
impl Unpin for RecordCache
impl !UnwindSafe for RecordCache
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