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
sourceimpl 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 get_app_info(
&self,
installed_app_id: &InstalledAppId
) -> Option<InstalledAppInfo>
pub fn get_app_info(
&self,
installed_app_id: &InstalledAppId
) -> Option<InstalledAppInfo>
Retrieve info about an installed App by its InstalledAppId
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
sourceimpl Clone for ConductorState
impl Clone for ConductorState
sourcefn clone(&self) -> ConductorState
fn clone(&self) -> ConductorState
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ConductorState
impl Debug for ConductorState
sourceimpl Default for ConductorState
impl Default for ConductorState
sourcefn default() -> ConductorState
fn default() -> ConductorState
sourceimpl<'de> Deserialize<'de> for ConductorState
impl<'de> Deserialize<'de> for ConductorState
sourcefn 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>,
sourceimpl Serialize for ConductorState
impl Serialize for ConductorState
sourceimpl TryFrom<&ConductorState> for SerializedBytes
impl TryFrom<&ConductorState> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn try_from(t: &ConductorState) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &ConductorState) -> Result<SerializedBytes, SerializedBytesError>
sourceimpl TryFrom<ConductorState> for SerializedBytes
impl TryFrom<ConductorState> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn try_from(t: ConductorState) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: ConductorState) -> Result<SerializedBytes, SerializedBytesError>
sourceimpl TryFrom<SerializedBytes> for ConductorState
impl TryFrom<SerializedBytes> for ConductorState
type Error = SerializedBytesError
type Error = SerializedBytesError
sourcefn 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> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
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>
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 morefn 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.