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>,
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>, algorithm: HashAlgorithm) -> Vc<Option<RcStr>>where
Self: Sized,
fn content_hash(self: Vc<Self>, algorithm: HashAlgorithm) -> Vc<Option<RcStr>>where
Self: Sized,
Hash of the content of the Asset.
Trait Implementations§
Source§impl VcValueTrait for Box<dyn Asset>
impl VcValueTrait for Box<dyn Asset>
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.
Source§fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>
fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>
Returns the vtable for an implementation of this trait.
Panics if ValueTypeId does not implement the trait.