Trait holochain::conductor::handle::ConductorHandleT[][src]

pub trait ConductorHandleT: Send + Sync {
Show 56 methods fn check_running(&self) -> ConductorResult<()>;
fn initialize_conductor<'async_trait>(
        self: Arc<Self>,
        admin_configs: Vec<AdminInterfaceConfig>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<CellStartupErrors>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn add_admin_interfaces<'async_trait>(
        self: Arc<Self>,
        configs: Vec<AdminInterfaceConfig>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn add_app_interface<'async_trait>(
        self: Arc<Self>,
        port: u16
    ) -> Pin<Box<dyn Future<Output = ConductorResult<u16>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn list_app_interfaces<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ConductorResult<Vec<u16>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn register_dna<'life0, 'async_trait>(
        &'life0 self,
        dna: DnaFile
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn list_dnas(&self) -> Vec<DnaHash>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
;
fn get_dna(&self, hash: &DnaHash) -> Option<DnaFile>;
fn get_ribosome(&self, dna_hash: &DnaHash) -> ConductorResult<RealRibosome>;
fn get_entry_def(&self, key: &EntryDefBufferKey) -> Option<EntryDef>;
fn load_dnas<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn dispatch_holochain_p2p_event<'life0, 'async_trait>(
        &'life0 self,
        event: HolochainP2pEvent
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn call_zome<'life0, 'async_trait>(
        &'life0 self,
        invocation: ZomeCall
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<ZomeCallResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn call_zome_with_workspace<'life0, 'async_trait>(
        &'life0 self,
        invocation: ZomeCall,
        workspace_lock: HostFnWorkspace
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<ZomeCallResult>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn get_arbitrary_admin_websocket_port(&self) -> Option<u16>;
fn take_shutdown_handle(&self) -> Option<JoinHandle<TaskManagerResult>>;
fn shutdown(&self);
fn keystore(&self) -> &MetaLairClient;
fn holochain_p2p(&self) -> &HolochainP2pRef;
fn create_clone_cell<'async_trait>(
        self: Arc<Self>,
        payload: CreateCloneCellPayload
    ) -> Pin<Box<dyn Future<Output = ConductorResult<CellId>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn destroy_clone_cell<'async_trait>(
        self: Arc<Self>,
        cell_id: CellId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn install_app<'async_trait>(
        self: Arc<Self>,
        installed_app_id: InstalledAppId,
        cell_data_with_proofs: Vec<(InstalledCell, Option<MembraneProof>)>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn install_app_bundle<'async_trait>(
        self: Arc<Self>,
        payload: InstallAppBundlePayload
    ) -> Pin<Box<dyn Future<Output = ConductorResult<StoppedApp>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn uninstall_app<'life0, 'async_trait>(
        self: Arc<Self>,
        app: &'life0 InstalledAppId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn reconcile_app_status_with_cell_status<'life0, 'async_trait>(
        &'life0 self,
        app_ids: Option<HashSet<InstalledAppId>>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<AppStatusFx>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn reconcile_cell_status_with_app_status<'async_trait>(
        self: Arc<Self>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<CellStartupErrors>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn enable_app<'async_trait>(
        self: Arc<Self>,
        app_id: InstalledAppId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<(InstalledApp, CellStartupErrors)>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn disable_app<'async_trait>(
        self: Arc<Self>,
        app_id: InstalledAppId,
        reason: DisabledAppReason
    ) -> Pin<Box<dyn Future<Output = ConductorResult<InstalledApp>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn start_app<'async_trait>(
        self: Arc<Self>,
        app_id: InstalledAppId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<InstalledApp>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn start_scheduler<'async_trait>(
        self: Arc<Self>,
        interval_period: Duration
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn dispatch_scheduled_fns<'async_trait>(
        self: Arc<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn post_commit_permit<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<OwnedPermit<PostCommitArgs>, SendError<()>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn pause_app<'async_trait>(
        self: Arc<Self>,
        app_id: InstalledAppId,
        reason: PausedAppReason
    ) -> Pin<Box<dyn Future<Output = ConductorResult<InstalledApp>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
fn list_cell_ids(&self, filter: Option<CellStatus>) -> Vec<CellId>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
;
fn list_running_apps<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ConductorResult<Vec<InstalledAppId>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn list_apps<'life0, 'async_trait>(
        &'life0 self,
        status_filter: Option<AppStatusFilter>
    ) -> Pin<Box<dyn Future<Output = ConductorResult<Vec<InstalledAppInfo>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn list_running_apps_for_required_cell_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cell_id: &'life1 CellId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<HashSet<InstalledAppId>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn dump_cell_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cell_id: &'life1 CellId
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<String>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn dump_full_cell_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cell_id: &'life1 CellId,
        dht_ops_cursor: Option<u64>
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<FullStateDump>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn signal_broadcaster<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = SignalBroadcaster> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn get_app_info<'life0, 'life1, 'async_trait>(
        &'life0 self,
        installed_app_id: &'life1 InstalledAppId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<Option<InstalledAppInfo>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn add_agent_infos<'life0, 'async_trait>(
        &'life0 self,
        agent_infos: Vec<AgentInfoSigned>
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn get_agent_infos<'life0, 'async_trait>(
        &'life0 self,
        cell_id: Option<CellId>
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<Vec<AgentInfoSigned>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn print_setup(&self);
fn get_cell_env_readonly(
        &self,
        cell_id: &CellId
    ) -> ConductorApiResult<EnvRead>;
fn remove_cells<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cell_ids: &'life1 [CellId]
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn get_cell_env(&self, cell_id: &CellId) -> ConductorApiResult<EnvWrite>;
fn get_cache_env(&self, cell_id: &CellId) -> ConductorApiResult<EnvWrite>;
fn get_p2p_env(&self, space: Arc<KitsuneSpace>) -> EnvWrite;
fn get_cell_triggers(
        &self,
        cell_id: &CellId
    ) -> ConductorApiResult<QueueTriggers>;
fn get_state_from_handle<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ConductorApiResult<ConductorState>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn add_test_app_interface<'life0, 'async_trait>(
        &'life0 self,
        id: AppInterfaceId
    ) -> Pin<Box<dyn Future<Output = ConductorResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn dev_settings(&self) -> DevSettings;
fn update_dev_settings(&self, delta: DevSettingsDelta);
fn update_cell_status(&self, cell_ids: &[CellId], status: CellStatus);
fn transition_app_status<'life0, 'async_trait>(
        &'life0 self,
        app_id: InstalledAppId,
        transition: AppStatusTransition
    ) -> Pin<Box<dyn Future<Output = ConductorResult<(InstalledApp, AppStatusFx)>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
}
Expand description

Base trait for ConductorHandle

Required methods

Returns error if conductor is shutting down

Initialize the task manager, add admin interfaces from config, start up app interfaces from db, and register all tasks.

This requires a concrete ConductorHandle to be passed into the interface tasks. This is a bit weird to do, but it was the only way around having a circular reference in the types.

Never use a ConductorHandle for different Conductor here!

Add a collection of admin interfaces from config

Add an app interface

List the app interfaces currently install.

Install a DnaFile in this Conductor

Get the list of hashes of installed Dnas in this Conductor

Get a Dna from the DnaStore

Get an instance of a RealRibosome for the DnaHash

fn get_entry_def(&self, key: &EntryDefBufferKey) -> Option<EntryDef>

Get a EntryDef from the [EntryDefBuffer]

Add the DnaFiles from the wasm and dna_def databases into memory

Dispatch a network event to the correct cell. Warning: returning an error from this function kills the network for the conductor.

Invoke a zome function on a Cell

Invoke a zome function on a Cell with a workspace

Get a Websocket port which will

Return the JoinHandle for all managed tasks, which when resolved will signal that the Conductor has completely shut down.

NB: The JoinHandle is not cloneable, so this can only ever be called successfully once.

Send a signal to all managed tasks asking them to end ASAP.

Request access to this conductor’s keystore

Request access to this conductor’s networking handle

Create a new Cell in an existing App based on an existing DNA

Destroy a cloned Cell

Install Cells into ConductorState based on installation info, and run genesis on all new source chains

Install DNAs and set up Cells as specified by an AppBundle

Uninstall an app from the state DB and remove all running Cells

Adjust app statuses (via state transitions) to match the current reality of which Cells are present in the conductor.

Adjust which cells are present in the Conductor (adding and removing as needed) to match the current reality of all app statuses.

  • If a Cell is used by at least one Running app, then ensure it is added
  • If a Cell is used by no running apps, then ensure it is removed.

Activate an app

Disable an app

Start an enabled but stopped (paused) app

Start the scheduler. All ephemeral tasks are deleted.

Dispatch all due scheduled functions.

Get an OwnedPermit to the post commit task.

Stop a running app while leaving it enabled. FOR TESTING ONLY.

List Cell Ids

List Active AppIds

List Apps with their information

Get the IDs of all active installed Apps which use this Cell

Dump the cells state

Dump the full cells state

Access the broadcast Sender which will send a Signal across every attached app interface

Get info about an installed App, whether active or inactive

Add signed agent info to the conductor

Get signed agent info from the conductor

Print the current setup in a machine readable way.

Retrieve the environment for this cell.

Manually remove some cells. Should only be used when handling errors in Cells, allowing individual Cells to be shut down.

Retrieve the environment for this cell. FOR TESTING ONLY.

Retrieve the database for this cell. FOR TESTING ONLY.

Retrieve the database for networking. FOR TESTING ONLY.

Retrieve Senders for triggering workflows. FOR TESTING ONLY.

Retrieve the ConductorState. FOR TESTING ONLY.

Add a “test” app interface for sending and receiving signals. FOR TESTING ONLY.

Get the current dev settings

Update the current dev settings

Manually coerce cells to a given CellStatus. FOR TESTING ONLY.

Manually coerce app to a given AppStatus. FOR TESTING ONLY.

Implementors

Base trait for ConductorHandle