pub trait Asset:
Send
+ Sync
+ NonLocalValue
+ ValueDebug {
// Required method
fn content(self: Vc<Self>) -> Vc<AssetContent>
where Self: Sized;
// Provided methods
fn versioned_content(self: Vc<Self>) -> Vc<Box<dyn VersionedContent>>
where Self: Sized { ... }
fn content_hash(
self: Vc<Self>,
salt: Vc<RcStr>,
algorithm: HashAlgorithm,
) -> Vc<Option<RcStr>>
where Self: Sized { ... }
}Expand description
A file or intermediate result containing content as a Rope or a symlink.
This is a supertrait for Source, OutputAsset, and OutputChunk.
Required Methods§
Provided Methods§
Sourcefn versioned_content(self: Vc<Self>) -> Vc<Box<dyn VersionedContent>>where
Self: Sized,
fn versioned_content(self: Vc<Self>) -> Vc<Box<dyn VersionedContent>>where
Self: Sized,
The content of the Asset alongside its version.
Sourcefn content_hash(
self: Vc<Self>,
salt: Vc<RcStr>,
algorithm: HashAlgorithm,
) -> Vc<Option<RcStr>>where
Self: Sized,
fn content_hash(
self: Vc<Self>,
salt: Vc<RcStr>,
algorithm: HashAlgorithm,
) -> Vc<Option<RcStr>>where
Self: Sized,
Hash of the content of the Asset. If salt is non-empty it is mixed
into the hash in a single pass before the file bytes.
Trait Implementations§
impl Dynamic<Box<dyn Asset>> for Box<dyn Asset>
impl Dynamic<Box<dyn Asset>> for Box<dyn OutputChunk>
impl Dynamic<Box<dyn Asset>> for Box<dyn OutputAsset>
impl Dynamic<Box<dyn Asset>> for Box<dyn Source>
impl Dynamic<Box<dyn ValueDebug>> for Box<dyn Asset>
Available on debug-assertions enabled only.
impl Upcast<Box<dyn Asset>> for Box<dyn Asset>
impl Upcast<Box<dyn Asset>> for Box<dyn OutputChunk>
impl Upcast<Box<dyn Asset>> for DataUriSource
impl Upcast<Box<dyn Asset>> for FileSource
impl Upcast<Box<dyn Asset>> for GeneratedCodeSource
impl Upcast<Box<dyn Asset>> for Box<dyn OutputAsset>
impl Upcast<Box<dyn Asset>> for ProxiedAsset
impl Upcast<Box<dyn Asset>> for RawOutput
impl Upcast<Box<dyn Asset>> for RebasedAsset
impl Upcast<Box<dyn Asset>> for Box<dyn Source>
impl Upcast<Box<dyn Asset>> for SourceMapAsset
impl Upcast<Box<dyn Asset>> for VirtualOutputAsset
impl Upcast<Box<dyn Asset>> for VirtualSource
impl Upcast<Box<dyn ValueDebug>> for Box<dyn Asset>
Available on debug-assertions enabled only.
impl UpcastStrict<Box<dyn Asset>> for Box<dyn OutputChunk>
impl UpcastStrict<Box<dyn Asset>> for DataUriSource
impl UpcastStrict<Box<dyn Asset>> for FileSource
impl UpcastStrict<Box<dyn Asset>> for GeneratedCodeSource
impl UpcastStrict<Box<dyn Asset>> for Box<dyn OutputAsset>
impl UpcastStrict<Box<dyn Asset>> for ProxiedAsset
impl UpcastStrict<Box<dyn Asset>> for RawOutput
impl UpcastStrict<Box<dyn Asset>> for RebasedAsset
impl UpcastStrict<Box<dyn Asset>> for Box<dyn Source>
impl UpcastStrict<Box<dyn Asset>> for SourceMapAsset
impl UpcastStrict<Box<dyn Asset>> for VirtualOutputAsset
impl UpcastStrict<Box<dyn Asset>> for VirtualSource
impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Asset>
Available on debug-assertions enabled only.
Source§impl VcValueTrait for Box<dyn Asset>
impl VcValueTrait for Box<dyn Asset>
Source§const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
type ValueTrait = dyn Asset
Source§fn get_trait_type_id() -> TraitTypeId
fn get_trait_type_id() -> TraitTypeId
Returns the type id of the trait object.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".