pub struct CachedAsset {
pub id: String,
pub filename: String,
pub mime_type: Option<String>,
pub size: u64,
pub local_path: PathBuf,
pub context: AssetContext,
pub checksum_sha256: String,
pub remote_url: Option<String>,
pub downloaded_at_ms: u64,
pub last_accessed_ms: u64,
}Expand description
A single cached asset as persisted in the index.
Fields§
§id: StringStable identifier (UUID or provider id).
filename: String§mime_type: Option<String>MIME type if known.
size: u64§local_path: PathBufPath relative to the cache root.
context: AssetContextContext the asset belongs to.
checksum_sha256: StringSHA-256 checksum in hex.
remote_url: Option<String>Remote URL at the provider, if available.
downloaded_at_ms: u64UNIX epoch milliseconds — when the file was first downloaded.
last_accessed_ms: u64UNIX epoch milliseconds — when the file was last accessed.
Implementations§
Source§impl CachedAsset
impl CachedAsset
Sourcepub fn new(params: NewCachedAsset) -> Self
pub fn new(params: NewCachedAsset) -> Self
Convenience constructor — wraps NewCachedAsset and stamps
downloaded_at / last_accessed to the current time.
Trait Implementations§
Source§impl Clone for CachedAsset
impl Clone for CachedAsset
Source§fn clone(&self) -> CachedAsset
fn clone(&self) -> CachedAsset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CachedAsset
impl Debug for CachedAsset
Source§impl<'de> Deserialize<'de> for CachedAsset
impl<'de> Deserialize<'de> for CachedAsset
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
Source§impl PartialEq for CachedAsset
impl PartialEq for CachedAsset
Source§fn eq(&self, other: &CachedAsset) -> bool
fn eq(&self, other: &CachedAsset) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CachedAsset
impl Serialize for CachedAsset
impl StructuralPartialEq for CachedAsset
Auto Trait Implementations§
impl Freeze for CachedAsset
impl RefUnwindSafe for CachedAsset
impl Send for CachedAsset
impl Sync for CachedAsset
impl Unpin for CachedAsset
impl UnsafeUnpin for CachedAsset
impl UnwindSafe for CachedAsset
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