Skip to main content

Version

Trait Version 

Source
pub trait Version:
    Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required method
    fn id(self: Vc<Self>) -> Vc<RcStr>
       where Self: Sized;
}
Expand description

Describes the current version of an object, and how to update them from an earlier version.

Important: Implementations must not contain instances of [Vc]! This should describe a specific version, and the value of a [Vc] can change due to invalidations or cache eviction.

Required Methods§

Source

fn id(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized,

Get a unique identifier of the version as a string. There is no way to convert an id back to its original Version, so the original object needs to be stored somewhere.

Trait Implementations§

Source§

impl Dynamic<Box<dyn ValueDebug>> for Box<dyn Version>

Available on debug-assertions enabled only.
Source§

impl Dynamic<Box<dyn Version>> for Box<dyn Version>

Source§

impl TraitVtablePrototype for Box<dyn Version>

Source§

const LEN: usize = 1usize

Source§

const DEFAULTS: &[Option<&NativeFunction>]

Source§

impl Upcast<Box<dyn ValueDebug>> for Box<dyn Version>

Available on debug-assertions enabled only.
Source§

impl Upcast<Box<dyn Version>> for Box<dyn Version>

Source§

impl Upcast<Box<dyn Version>> for NotFoundVersion

Source§

impl Upcast<Box<dyn Version>> for FileHashVersion

Source§

impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Version>

Available on debug-assertions enabled only.
Source§

impl UpcastStrict<Box<dyn Version>> for NotFoundVersion

Source§

impl UpcastStrict<Box<dyn Version>> for FileHashVersion

Source§

impl VcValueTrait for Box<dyn Version>

Source§

const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>

The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
Source§

type ValueTrait = dyn Version

Source§

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".

Implementors§

Source§

impl Version for FileHashVersion

Source§

impl Version for NotFoundVersion

Source§

impl<T> Version for T
where T: Dynamic<Box<dyn Version>> + Send + Sync + NonLocalValue + ValueDebug,