pub struct ChartRegistry { /* private fields */ }Expand description
Every chart version an actor may run, keyed by version IRI, the versions of each chart type in registration order, and the declared migrations.
Implementations§
Source§impl ChartRegistry
impl ChartRegistry
Sourcepub fn insert(&mut self, info: ChartInfo) -> Arc<ChartInfo> ⓘ
pub fn insert(&mut self, info: ChartInfo) -> Arc<ChartInfo> ⓘ
Adds a version (idempotent) and, with a type, makes it the type’s latest version.
Sourcepub fn latest(&self, ty: &str) -> Option<Arc<ChartInfo>>
pub fn latest(&self, ty: &str) -> Option<Arc<ChartInfo>>
The latest version registered for chart type ty.
Sourcepub fn versions_of(&self, ty: &str) -> Vec<String>
pub fn versions_of(&self, ty: &str) -> Vec<String>
The versions registered for chart type ty, oldest first.
Sourcepub fn type_of(&self, address: &str) -> Option<(String, String)>
pub fn type_of(&self, address: &str) -> Option<(String, String)>
The chart type and key of a virtual actor address (<type>/<key>), for the longest
registered type that prefixes it, or the type and key the address is bound to.
Sourcepub fn bind(&mut self, address: &str, chart_type: &str, key: &str)
pub fn bind(&mut self, address: &str, chart_type: &str, key: &str)
Binds address to the virtual actor of chart_type with key, for addresses that do
not have the <type>/<key> form, such as an instance whose address is its DID.
Sourcepub fn remove(&mut self, iri: &str) -> bool
pub fn remove(&mut self, iri: &str) -> bool
Removes version iri; the caller has checked that no non-final actor uses it.
Sourcepub fn add_migration(&mut self, m: Migration)
pub fn add_migration(&mut self, m: Migration)
Declares a migration.
Trait Implementations§
Source§impl Debug for ChartRegistry
impl Debug for ChartRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ChartRegistry
impl !UnwindSafe for ChartRegistry
impl Forget for ChartRegistry
impl Freeze for ChartRegistry
impl Move for ChartRegistry
impl Send for ChartRegistry
impl Sync for ChartRegistry
impl Unpin for ChartRegistry
impl UnsafeUnpin for ChartRegistry
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