pub struct CacheObject { /* private fields */ }Expand description
Represents an individual cache object with file operations
Implementations§
Source§impl CacheObject
impl CacheObject
Sourcepub fn created_at(&self) -> SystemTime
pub fn created_at(&self) -> SystemTime
Sourcepub fn get_file(&self) -> CacheResult<File>
pub fn get_file(&self) -> CacheResult<File>
Sourcepub fn get_string(&self) -> CacheResult<String>
pub fn get_string(&self) -> CacheResult<String>
Reads and returns the entire cache content as string
§Returns
CacheResult<String> - Cache content or error
Sourcepub fn write_string(&self, content: &str) -> CacheResult<()>
pub fn write_string(&self, content: &str) -> CacheResult<()>
Sourcepub fn write_bytes(&self, content: &[u8]) -> CacheResult<()>
pub fn write_bytes(&self, content: &[u8]) -> CacheResult<()>
Sourcepub fn get_bytes(&self) -> CacheResult<Vec<u8>>
pub fn get_bytes(&self) -> CacheResult<Vec<u8>>
Reads and returns the entire cache content as bytes
§Returns
CacheResult<Vec<u8>> - Cache content or error
Sourcepub fn delete(&self) -> CacheResult<()>
pub fn delete(&self) -> CacheResult<()>
Sourcepub fn size(&self) -> CacheResult<u64>
pub fn size(&self) -> CacheResult<u64>
Sourcepub fn is_expired(&self) -> bool
👎Deprecated: This enumeration has been deprecated due to issues, and it now only returns false
pub fn is_expired(&self) -> bool
Checks if the cache has expired based on its lifecycle policy
§Returns
bool - True if expired, false otherwise
Trait Implementations§
Source§impl Clone for CacheObject
impl Clone for CacheObject
Auto Trait Implementations§
impl Freeze for CacheObject
impl RefUnwindSafe for CacheObject
impl Send for CacheObject
impl Sync for CacheObject
impl Unpin for CacheObject
impl UnwindSafe for CacheObject
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