Skip to main content

ChartRegistry

Struct ChartRegistry 

Source
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

Source

pub fn insert(&mut self, info: ChartInfo) -> Arc<ChartInfo> ⓘ

Adds a version (idempotent) and, with a type, makes it the type’s latest version.

Source

pub fn get(&self, iri: &str) -> Option<Arc<ChartInfo>>

The version iri.

Source

pub fn latest(&self, ty: &str) -> Option<Arc<ChartInfo>>

The latest version registered for chart type ty.

Source

pub fn versions_of(&self, ty: &str) -> Vec<String>

The versions registered for chart type ty, oldest first.

Source

pub fn types(&self) -> impl Iterator<Item = &String>

Every registered chart type.

Source

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.

Source

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.

Source

pub fn remove(&mut self, iri: &str) -> bool

Removes version iri; the caller has checked that no non-final actor uses it.

Source

pub fn add_migration(&mut self, m: Migration)

Declares a migration.

Source

pub fn migration(&self, iri: &str) -> Option<Migration>

The migration iri.

Trait Implementations§

Source§

impl Debug for ChartRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChartRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V