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>
impl<SE, PA> SystemManager<SE, PA>
pub fn root(&self) -> Option<Attested<EntityState>>
pub fn items(&self) -> Vec<Entity>
Sourcepub async fn collection(
&self,
id: &CollectionId,
) -> Result<StorageCollectionWrapper, RetrievalError>
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
Sourcepub fn is_system_ready(&self) -> bool
pub fn is_system_ready(&self) -> bool
Returns true if we’ve successfully initialized or joined a system
Sourcepub async fn wait_system_ready(&self)
pub async fn wait_system_ready(&self)
Waits until we’ve successfully initialized or joined a system
Sourcepub async fn create(&self) -> Result<()>
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.
Sourcepub async fn join_system(
&self,
state: Attested<EntityState>,
) -> Result<(), MutationError>
pub async fn join_system( &self, state: Attested<EntityState>, ) -> Result<(), MutationError>
Joins an existing system. This should only be called by ephemeral nodes.
Sourcepub async fn hard_reset(&self) -> Result<()>
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.
Sourcepub async fn wait_loaded(&self)
pub async fn wait_loaded(&self)
Waits for the local system catalog to be loaded
Trait Implementations§
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>
impl<SE, PA> Sync for SystemManager<SE, PA>
impl<SE, PA> Unpin for SystemManager<SE, PA>
impl<SE, PA> !UnwindSafe for SystemManager<SE, PA>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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