Struct holochain_types::app::InstalledAppCommon
source · pub struct InstalledAppCommon { /* private fields */ }
Expand description
The common data between apps of any status
Implementations§
source§impl InstalledAppCommon
impl InstalledAppCommon
sourcepub fn new<S: ToString, I: IntoIterator<Item = (RoleName, AppRoleAssignment)>>(
installed_app_id: S,
agent_key: AgentPubKey,
role_assignments: I,
manifest: AppManifest
) -> AppResult<Self>
pub fn new<S: ToString, I: IntoIterator<Item = (RoleName, AppRoleAssignment)>>( installed_app_id: S, agent_key: AgentPubKey, role_assignments: I, manifest: AppManifest ) -> AppResult<Self>
Constructor
sourcepub fn id(&self) -> &InstalledAppId
pub fn id(&self) -> &InstalledAppId
Accessor
sourcepub fn provisioned_cells(&self) -> impl Iterator<Item = (&RoleName, &CellId)>
pub fn provisioned_cells(&self) -> impl Iterator<Item = (&RoleName, &CellId)>
Accessor
sourcepub fn into_provisioned_cells(self) -> impl Iterator<Item = (RoleName, CellId)>
pub fn into_provisioned_cells(self) -> impl Iterator<Item = (RoleName, 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: &RoleName
) -> Option<&HashMap<CloneId, CellId>>
pub fn clone_cells_for_role_name( &self, role_name: &RoleName ) -> Option<&HashMap<CloneId, CellId>>
Accessor
sourcepub fn disabled_clone_cells_for_role_name(
&self,
role_name: &RoleName
) -> Option<&HashMap<CloneId, CellId>>
pub fn disabled_clone_cells_for_role_name( &self, role_name: &RoleName ) -> 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: &RoleName) -> AppResult<&AppRoleAssignment>
pub fn role(&self, role_name: &RoleName) -> AppResult<&AppRoleAssignment>
Accessor for particular role
sourcepub fn roles(&self) -> &HashMap<RoleName, AppRoleAssignment>
pub fn roles(&self) -> &HashMap<RoleName, AppRoleAssignment>
Accessor
sourcepub fn add_clone(
&mut self,
role_name: &RoleName,
cell_id: &CellId
) -> AppResult<CloneId>
pub fn add_clone( &mut self, role_name: &RoleName, cell_id: &CellId ) -> AppResult<CloneId>
Add a clone cell.
sourcepub fn get_clone_cell_id(
&self,
clone_cell_id: &CloneCellId
) -> AppResult<CellId>
pub fn get_clone_cell_id( &self, clone_cell_id: &CloneCellId ) -> AppResult<CellId>
Get a clone cell id from its clone id.
sourcepub fn get_clone_id(&self, clone_cell_id: &CloneCellId) -> AppResult<CloneId>
pub fn get_clone_id(&self, clone_cell_id: &CloneCellId) -> AppResult<CloneId>
Get the clone id from either clone or cell id.
sourcepub fn get_disabled_clone_id(
&self,
clone_cell_id: &CloneCellId
) -> AppResult<CloneId>
pub fn get_disabled_clone_id( &self, clone_cell_id: &CloneCellId ) -> AppResult<CloneId>
Get the clone id from either clone or cell id.
sourcepub fn disable_clone_cell(&mut self, clone_id: &CloneId) -> AppResult<()>
pub fn disable_clone_cell(&mut self, clone_id: &CloneId) -> AppResult<()>
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
) -> AppResult<InstalledCell>
pub fn enable_clone_cell( &mut self, clone_id: &CloneId ) -> AppResult<InstalledCell>
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) -> AppResult<()>
pub fn delete_clone_cell(&mut self, clone_id: &CloneId) -> AppResult<()>
Delete a disabled clone cell.
sourcepub fn agent_key(&self) -> &AgentPubKey
pub fn agent_key(&self) -> &AgentPubKey
Accessor
sourcepub fn new_legacy<S: ToString, I: IntoIterator<Item = InstalledCell>>(
installed_app_id: S,
installed_cells: I
) -> AppResult<Self>
pub fn new_legacy<S: ToString, I: IntoIterator<Item = InstalledCell>>( installed_app_id: S, installed_cells: I ) -> AppResult<Self>
Constructor for apps not using a manifest. Allows for cloning up to 256 times and implies immediate provisioning.
sourcepub fn manifest(&self) -> &AppManifest
pub fn manifest(&self) -> &AppManifest
Return the manifest if available
sourcepub fn role_assignments(&self) -> &HashMap<RoleName, AppRoleAssignment>
pub fn role_assignments(&self) -> &HashMap<RoleName, 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 AsMut<InstalledAppCommon> for RunningApp
impl AsMut<InstalledAppCommon> for RunningApp
source§fn as_mut(&mut self) -> &mut InstalledAppCommon
fn as_mut(&mut self) -> &mut InstalledAppCommon
source§impl AsMut<InstalledAppCommon> for StoppedApp
impl AsMut<InstalledAppCommon> for StoppedApp
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 AsRef<InstalledAppCommon> for RunningApp
impl AsRef<InstalledAppCommon> for RunningApp
source§fn as_ref(&self) -> &InstalledAppCommon
fn as_ref(&self) -> &InstalledAppCommon
source§impl AsRef<InstalledAppCommon> for StoppedApp
impl AsRef<InstalledAppCommon> for StoppedApp
source§fn as_ref(&self) -> &InstalledAppCommon
fn as_ref(&self) -> &InstalledAppCommon
source§impl Borrow<InstalledAppCommon> for InstalledApp
impl Borrow<InstalledAppCommon> for InstalledApp
source§fn borrow(&self) -> &InstalledAppCommon
fn borrow(&self) -> &InstalledAppCommon
source§impl Borrow<InstalledAppCommon> for RunningApp
impl Borrow<InstalledAppCommon> for RunningApp
source§fn borrow(&self) -> &InstalledAppCommon
fn borrow(&self) -> &InstalledAppCommon
source§impl Borrow<InstalledAppCommon> for StoppedApp
impl Borrow<InstalledAppCommon> for StoppedApp
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 BorrowMut<InstalledAppCommon> for RunningApp
impl BorrowMut<InstalledAppCommon> for RunningApp
source§fn borrow_mut(&mut self) -> &mut InstalledAppCommon
fn borrow_mut(&mut self) -> &mut InstalledAppCommon
source§impl BorrowMut<InstalledAppCommon> for StoppedApp
impl BorrowMut<InstalledAppCommon> for StoppedApp
source§fn borrow_mut(&mut self) -> &mut InstalledAppCommon
fn borrow_mut(&mut self) -> &mut InstalledAppCommon
source§impl Clone for InstalledAppCommon
impl Clone for InstalledAppCommon
source§fn clone(&self) -> InstalledAppCommon
fn clone(&self) -> InstalledAppCommon
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InstalledAppCommon
impl Debug for InstalledAppCommon
source§impl<'de> Deserialize<'de> for InstalledAppCommon
impl<'de> Deserialize<'de> for InstalledAppCommon
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 From<InstalledAppCommon> for RunningApp
impl From<InstalledAppCommon> for RunningApp
source§fn from(original: InstalledAppCommon) -> RunningApp
fn from(original: InstalledAppCommon) -> RunningApp
source§impl From<StoppedApp> for InstalledAppCommon
impl From<StoppedApp> for InstalledAppCommon
source§fn from(d: StoppedApp) -> Self
fn from(d: StoppedApp) -> Self
source§impl PartialEq<InstalledAppCommon> for InstalledAppCommon
impl PartialEq<InstalledAppCommon> for InstalledAppCommon
source§fn eq(&self, other: &InstalledAppCommon) -> bool
fn eq(&self, other: &InstalledAppCommon) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for InstalledAppCommon
impl Serialize for InstalledAppCommon
impl Eq for InstalledAppCommon
impl StructuralEq for InstalledAppCommon
impl StructuralPartialEq for InstalledAppCommon
Auto Trait Implementations§
impl RefUnwindSafe for InstalledAppCommon
impl Send for InstalledAppCommon
impl Sync for InstalledAppCommon
impl Unpin for InstalledAppCommon
impl UnwindSafe for InstalledAppCommon
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>
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<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
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.