Struct holochain::conductor::state::ConductorState
source · pub struct ConductorState { /* private fields */ }
Expand description
Mutable conductor state, stored in a DB and writable only via Admin interface.
References between structs (cell configs pointing to the agent and DNA to be instantiated) are implemented via string IDs.
Implementations§
source§impl ConductorState
impl ConductorState
sourcepub fn tag(&self) -> &ConductorStateTag
pub fn tag(&self) -> &ConductorStateTag
A unique identifier for this conductor
sourcepub fn installed_apps(&self) -> &InstalledAppMap
pub fn installed_apps(&self) -> &InstalledAppMap
Immutable access to the inner collection of all apps
sourcepub fn installed_apps_mut(&mut self) -> &mut InstalledAppMap
👎Deprecated: Bare mutable access isn’t the best idea
pub fn installed_apps_mut(&mut self) -> &mut InstalledAppMap
Mutable access to the inner collection of all apps
sourcepub fn enabled_apps(
&self
) -> impl Iterator<Item = (&InstalledAppId, &InstalledApp)> + '_
pub fn enabled_apps( &self ) -> impl Iterator<Item = (&InstalledAppId, &InstalledApp)> + '_
Iterate over only the “enabled” apps
sourcepub fn disabled_apps(
&self
) -> impl Iterator<Item = (&InstalledAppId, &InstalledApp)> + '_
pub fn disabled_apps( &self ) -> impl Iterator<Item = (&InstalledAppId, &InstalledApp)> + '_
Iterate over only the “disabled” apps
sourcepub fn running_apps(
&self
) -> impl Iterator<Item = (&InstalledAppId, RunningApp)> + '_
pub fn running_apps( &self ) -> impl Iterator<Item = (&InstalledAppId, RunningApp)> + '_
Iterate over only the “running” apps
sourcepub fn paused_apps(
&self
) -> impl Iterator<Item = (&InstalledAppId, StoppedApp)> + '_
pub fn paused_apps( &self ) -> impl Iterator<Item = (&InstalledAppId, StoppedApp)> + '_
Iterate over only the paused apps
sourcepub fn stopped_apps(
&self
) -> impl Iterator<Item = (&InstalledAppId, StoppedApp)> + '_
pub fn stopped_apps( &self ) -> impl Iterator<Item = (&InstalledAppId, StoppedApp)> + '_
Iterate over only the “stopped” apps (paused OR disabled)
sourcepub fn get_app(&self, id: &InstalledAppId) -> ConductorResult<&InstalledApp>
pub fn get_app(&self, id: &InstalledAppId) -> ConductorResult<&InstalledApp>
Getter for a single app. Returns error if app missing.
sourcepub fn get_app_mut(
&mut self,
id: &InstalledAppId
) -> ConductorResult<&mut InstalledApp>
pub fn get_app_mut( &mut self, id: &InstalledAppId ) -> ConductorResult<&mut InstalledApp>
Getter for a mutable reference to a single app. Returns error if app missing.
sourcepub fn remove_app(
&mut self,
id: &InstalledAppId
) -> ConductorResult<InstalledApp>
pub fn remove_app( &mut self, id: &InstalledAppId ) -> ConductorResult<InstalledApp>
Getter for a single app. Returns error if app missing.
sourcepub fn add_app(
&mut self,
app: InstalledAppCommon
) -> ConductorResult<StoppedApp>
pub fn add_app( &mut self, app: InstalledAppCommon ) -> ConductorResult<StoppedApp>
Add an app in the Deactivated state. Returns an error if an app is already present at the given ID.
sourcepub fn transition_app_status(
&mut self,
id: &InstalledAppId,
transition: AppStatusTransition
) -> ConductorResult<(&InstalledApp, AppStatusFx)>
pub fn transition_app_status( &mut self, id: &InstalledAppId, transition: AppStatusTransition ) -> ConductorResult<(&InstalledApp, AppStatusFx)>
Update the status of an installed app in-place. Return a reference to the (possibly updated) app. Additionally, if an update occurred, return the previous state. If no update occurred, return None.
sourcepub fn interface_by_id(&self, id: &AppInterfaceId) -> Option<AppInterfaceConfig>
pub fn interface_by_id(&self, id: &AppInterfaceId) -> Option<AppInterfaceConfig>
Returns the interface configuration with the given ID if present
Trait Implementations§
source§impl Clone for ConductorState
impl Clone for ConductorState
source§fn clone(&self) -> ConductorState
fn clone(&self) -> ConductorState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConductorState
impl Debug for ConductorState
source§impl Default for ConductorState
impl Default for ConductorState
source§fn default() -> ConductorState
fn default() -> ConductorState
source§impl<'de> Deserialize<'de> for ConductorState
impl<'de> Deserialize<'de> for ConductorState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Serialize for ConductorState
impl Serialize for ConductorState
source§impl TryFrom<&ConductorState> for SerializedBytes
impl TryFrom<&ConductorState> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: &ConductorState) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &ConductorState) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<ConductorState> for SerializedBytes
impl TryFrom<ConductorState> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: ConductorState) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: ConductorState) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<SerializedBytes> for ConductorState
impl TryFrom<SerializedBytes> for ConductorState
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(sb: SerializedBytes) -> Result<ConductorState, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<ConductorState, SerializedBytesError>
Auto Trait Implementations§
impl RefUnwindSafe for ConductorState
impl Send for ConductorState
impl Sync for ConductorState
impl Unpin for ConductorState
impl UnwindSafe for ConductorState
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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> ⓘ
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.