Struct holochain::prelude::InstalledApp
source · pub struct InstalledApp {
pub status: AppStatus,
/* private fields */
}
Expand description
An app which has been installed. An installed app is merely its collection of “roles”, associated with an ID.
Fields§
§status: AppStatus
The status of the installed app
Implementations§
source§impl InstalledApp
impl InstalledApp
pub fn new(app: InstalledAppCommon, status: AppStatus) -> InstalledApp
source§impl InstalledApp
impl InstalledApp
sourcepub fn new_fresh(app: InstalledAppCommon) -> InstalledApp
pub fn new_fresh(app: InstalledAppCommon) -> InstalledApp
Constructor for freshly installed app
sourcepub fn new_running(app: InstalledAppCommon) -> InstalledApp
pub fn new_running(app: InstalledAppCommon) -> InstalledApp
Constructor for freshly installed app
sourcepub fn into_app_and_status(self) -> (InstalledAppCommon, AppStatus)
pub fn into_app_and_status(self) -> (InstalledAppCommon, AppStatus)
Return the common app info, as well as a status which encodes the remaining information
Methods from Deref<Target = InstalledAppCommon>§
sourcepub fn provisioned_cells(&self) -> impl Iterator<Item = (&String, &CellId)>
pub fn provisioned_cells(&self) -> impl Iterator<Item = (&String, &CellId)>
Accessor
sourcepub fn clone_cells(&self) -> impl Iterator<Item = (&CloneId, &CellId)>
pub fn clone_cells(&self) -> impl Iterator<Item = (&CloneId, &CellId)>
Accessor
sourcepub fn disabled_clone_cells(&self) -> impl Iterator<Item = (&CloneId, &CellId)>
pub fn disabled_clone_cells(&self) -> impl Iterator<Item = (&CloneId, &CellId)>
Accessor
sourcepub fn clone_cells_for_role_name(
&self,
role_name: &String
) -> Option<&HashMap<CloneId, CellId>>
pub fn clone_cells_for_role_name( &self, role_name: &String ) -> Option<&HashMap<CloneId, CellId>>
Accessor
sourcepub fn disabled_clone_cells_for_role_name(
&self,
role_name: &String
) -> Option<&HashMap<CloneId, CellId>>
pub fn disabled_clone_cells_for_role_name( &self, role_name: &String ) -> Option<&HashMap<CloneId, CellId>>
Accessor
sourcepub fn clone_cell_ids(&self) -> impl Iterator<Item = &CellId>
pub fn clone_cell_ids(&self) -> impl Iterator<Item = &CellId>
Accessor
sourcepub fn disabled_clone_cell_ids(&self) -> impl Iterator<Item = &CellId>
pub fn disabled_clone_cell_ids(&self) -> impl Iterator<Item = &CellId>
Accessor
sourcepub fn all_cells(&self) -> impl Iterator<Item = &CellId>
pub fn all_cells(&self) -> impl Iterator<Item = &CellId>
Iterator of all cells, both provisioned and cloned
sourcepub fn all_enabled_cells(&self) -> impl Iterator<Item = &CellId>
pub fn all_enabled_cells(&self) -> impl Iterator<Item = &CellId>
Iterator of all running cells, both provisioned and cloned. Provisioned cells will always be running if the app is running, but some cloned cells may be disabled and will not be returned.
sourcepub fn required_cells(&self) -> impl Iterator<Item = &CellId>
pub fn required_cells(&self) -> impl Iterator<Item = &CellId>
Iterator of all “required” cells, meaning Cells which must be running for this App to be able to run.
Currently this is simply all provisioned cells, but this concept may become more nuanced in the future.
sourcepub fn role(&self, role_name: &String) -> Result<&AppRoleAssignment, AppError>
pub fn role(&self, role_name: &String) -> Result<&AppRoleAssignment, AppError>
Accessor for particular role
sourcepub fn roles(&self) -> &HashMap<String, AppRoleAssignment>
pub fn roles(&self) -> &HashMap<String, AppRoleAssignment>
Accessor
sourcepub fn add_clone(
&mut self,
role_name: &String,
cell_id: &CellId
) -> Result<CloneId, AppError>
pub fn add_clone( &mut self, role_name: &String, cell_id: &CellId ) -> Result<CloneId, AppError>
Add a clone cell.
sourcepub fn get_clone_cell_id(
&self,
clone_cell_id: &CloneCellId
) -> Result<CellId, AppError>
pub fn get_clone_cell_id( &self, clone_cell_id: &CloneCellId ) -> Result<CellId, AppError>
Get a clone cell id from its clone id.
sourcepub fn get_clone_id(
&self,
clone_cell_id: &CloneCellId
) -> Result<CloneId, AppError>
pub fn get_clone_id( &self, clone_cell_id: &CloneCellId ) -> Result<CloneId, AppError>
Get the clone id from either clone or cell id.
sourcepub fn get_disabled_clone_id(
&self,
clone_cell_id: &CloneCellId
) -> Result<CloneId, AppError>
pub fn get_disabled_clone_id( &self, clone_cell_id: &CloneCellId ) -> Result<CloneId, AppError>
Get the clone id from either clone or cell id.
sourcepub fn disable_clone_cell(&mut self, clone_id: &CloneId) -> Result<(), AppError>
pub fn disable_clone_cell(&mut self, clone_id: &CloneId) -> Result<(), AppError>
Disable a clone cell.
Removes the cell from the list of clones, so it is not accessible any longer. If the cell is already disabled, do nothing and return Ok.
sourcepub fn enable_clone_cell(
&mut self,
clone_id: &CloneId
) -> Result<InstalledCell, AppError>
pub fn enable_clone_cell( &mut self, clone_id: &CloneId ) -> Result<InstalledCell, AppError>
Enable a disabled clone cell.
The clone cell is added back to the list of clones and can be accessed again. If the cell is already enabled, do nothing and return Ok.
Returns
The enabled clone cell.
sourcepub fn delete_clone_cell(&mut self, clone_id: &CloneId) -> Result<(), AppError>
pub fn delete_clone_cell(&mut self, clone_id: &CloneId) -> Result<(), AppError>
Delete a disabled clone cell.
sourcepub fn manifest(&self) -> &AppManifest
pub fn manifest(&self) -> &AppManifest
Return the manifest if available
sourcepub fn role_assignments(&self) -> &HashMap<String, AppRoleAssignment>
pub fn role_assignments(&self) -> &HashMap<String, AppRoleAssignment>
Return the list of role assignments
Trait Implementations§
source§impl AsMut<InstalledAppCommon> for InstalledApp
impl AsMut<InstalledAppCommon> for InstalledApp
source§fn as_mut(&mut self) -> &mut InstalledAppCommon
fn as_mut(&mut self) -> &mut InstalledAppCommon
source§impl AsRef<InstalledAppCommon> for InstalledApp
impl AsRef<InstalledAppCommon> for InstalledApp
source§fn as_ref(&self) -> &InstalledAppCommon
fn as_ref(&self) -> &InstalledAppCommon
source§impl AutoMapped for InstalledApp
impl AutoMapped for InstalledApp
source§impl Borrow<InstalledAppCommon> for InstalledApp
impl Borrow<InstalledAppCommon> for InstalledApp
source§fn borrow(&self) -> &InstalledAppCommon
fn borrow(&self) -> &InstalledAppCommon
source§impl BorrowMut<InstalledAppCommon> for InstalledApp
impl BorrowMut<InstalledAppCommon> for InstalledApp
source§fn borrow_mut(&mut self) -> &mut InstalledAppCommon
fn borrow_mut(&mut self) -> &mut InstalledAppCommon
source§impl Clone for InstalledApp
impl Clone for InstalledApp
source§fn clone(&self) -> InstalledApp
fn clone(&self) -> InstalledApp
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InstalledApp
impl Debug for InstalledApp
source§impl Deref for InstalledApp
impl Deref for InstalledApp
§type Target = InstalledAppCommon
type Target = InstalledAppCommon
source§impl DerefMut for InstalledApp
impl DerefMut for InstalledApp
source§impl<'de> Deserialize<'de> for InstalledApp
impl<'de> Deserialize<'de> for InstalledApp
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InstalledApp, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<InstalledApp, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl From<RunningApp> for InstalledApp
impl From<RunningApp> for InstalledApp
source§fn from(app: RunningApp) -> InstalledApp
fn from(app: RunningApp) -> InstalledApp
source§impl From<StoppedApp> for InstalledApp
impl From<StoppedApp> for InstalledApp
source§fn from(d: StoppedApp) -> InstalledApp
fn from(d: StoppedApp) -> InstalledApp
source§impl PartialEq for InstalledApp
impl PartialEq for InstalledApp
source§fn eq(&self, other: &InstalledApp) -> bool
fn eq(&self, other: &InstalledApp) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for InstalledApp
impl Serialize for InstalledApp
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl Eq for InstalledApp
impl StructuralEq for InstalledApp
impl StructuralPartialEq for InstalledApp
Auto Trait Implementations§
impl RefUnwindSafe for InstalledApp
impl Send for InstalledApp
impl Sync for InstalledApp
impl Unpin for InstalledApp
impl UnwindSafe for InstalledApp
Blanket Implementations§
§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 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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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> ⓘ
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> 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.