pub struct Assets { /* private fields */ }Expand description
Bounded project resource owner. Owners/handles retain project weak cache entries; dropping them releases cache payload charges. This is not a hard process-memory cap or an automatic file-change watcher.
Implementations§
Source§impl Assets
impl Assets
Sourcepub fn with_diagnostics(self, diagnostics: RequestDiagnostics) -> Self
pub fn with_diagnostics(self, diagnostics: RequestDiagnostics) -> Self
Derives a request-local view without changing resource identity or ownership. Handles created from this view keep the explicit sink across threads.
Sourcepub fn snapshot(&self) -> Self
pub fn snapshot(&self) -> Self
Freezes existing entries while isolating future registrations from old clones. Snapshot versions still share project accounting and existing decoded payloads.
Sourcepub fn preload<A: Asset>(
&self,
source: impl Into<Source>,
value: Arc<A>,
) -> Result<Handle<A>>
pub fn preload<A: Asset>( &self, source: impl Into<Source>, value: Arc<A>, ) -> Result<Handle<A>>
Registers decoded data in the same bounded entry used by lazy handles. Performs no file read; an already resolved source is never replaced.
Sourcepub fn with_store(self, store: ResourceStore) -> Self
pub fn with_store(self, store: ResourceStore) -> Self
Uses an explicit project store and drops this value’s retained entry table. Existing owner clones, handles and decoded values keep their original ownership.
Sourcepub fn store(&self) -> &ResourceStore
pub fn store(&self) -> &ResourceStore
Project cache identity and accounting shared by this owner’s clones.
Sourcepub fn remove<A: Asset>(&self, source: impl Into<Source>) -> bool
pub fn remove<A: Asset>(&self, source: impl Into<Source>) -> bool
Unregisters one typed source from this owner without invalidating handles. Clones share registrations; use snapshot() before independent edits. Retained snapshots and handles keep their payload charged until dropped.
Sourcepub fn with_fonts(self, fonts: impl Into<FontEnvironment>) -> Self
pub fn with_fonts(self, fonts: impl Into<FontEnvironment>) -> Self
Derives an independent resource view with an immutable font environment. Cache identity includes its snapshot; existing owners/handles stay valid.
Sourcepub fn fonts(&self) -> Option<&FontEnvironment>
pub fn fonts(&self) -> Option<&FontEnvironment>
Font snapshot shared by layout and explicit SVG parsing.