SystemManager

Struct SystemManager 

Source
pub struct SystemManager<SE, PA>(/* private fields */);
Expand description

System catalog manager for storing various metadata about the system

  • root clock
  • valid collections (TODO)
  • property definitions (TODO)

Implementations§

Source§

impl<SE, PA> SystemManager<SE, PA>
where SE: StorageEngine + Send + Sync + 'static, PA: PolicyAgent + Send + Sync + 'static,

Source

pub fn root(&self) -> Option<Attested<EntityState>>

Source

pub fn items(&self) -> Vec<Entity>

Source

pub async fn collection( &self, id: &CollectionId, ) -> Result<StorageCollectionWrapper, RetrievalError>

get an existing collection if it’s defined in the system catalog, else insert a SysItem::Collection then return collections.get to get the StorageCollectionWrapper

Source

pub fn is_system_ready(&self) -> bool

Returns true if we’ve successfully initialized or joined a system

Source

pub async fn wait_system_ready(&self)

Waits until we’ve successfully initialized or joined a system

Source

pub async fn create(&self) -> Result<()>

Creates a new system root. This should only be called once per system by durable nodes The rest of the nodes must “join” this system.

Source

pub async fn join_system( &self, state: Attested<EntityState>, ) -> Result<(), MutationError>

Joins an existing system. This should only be called by ephemeral nodes.

Source

pub async fn hard_reset(&self) -> Result<()>

Resets all storage by deleting all collections, including the system collection. This is used when an ephemeral node needs to join a system with a different root. This is a destructive operation and should be used with extreme caution.

Source

pub fn is_loaded(&self) -> bool

Returns true if the local system catalog is loaded

Source

pub async fn wait_loaded(&self)

Waits for the local system catalog to be loaded

Trait Implementations§

Source§

impl<SE, PA> Clone for SystemManager<SE, PA>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<SE, PA> Freeze for SystemManager<SE, PA>

§

impl<SE, PA> !RefUnwindSafe for SystemManager<SE, PA>

§

impl<SE, PA> Send for SystemManager<SE, PA>
where PA: Sync + Send, SE: Sync + Send,

§

impl<SE, PA> Sync for SystemManager<SE, PA>
where PA: Sync + Send, SE: Sync + Send,

§

impl<SE, PA> Unpin for SystemManager<SE, PA>

§

impl<SE, PA> !UnwindSafe for SystemManager<SE, PA>

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Iterable<T> for T

Source§

type Iter<'a> = Once<&'a T> where T: 'a

Source§

fn iterable(&self) -> <T as Iterable<T>>::Iter<'_>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more