Struct holochain::core::workflow::genesis_workflow::GenesisWorkflowArgs
source · pub struct GenesisWorkflowArgs<Ribosome>where
Ribosome: RibosomeT + 'static,{ /* private fields */ }
Expand description
The struct which implements the genesis Workflow
Implementations§
source§impl<Ribosome> GenesisWorkflowArgs<Ribosome>where
Ribosome: RibosomeT + 'static,
impl<Ribosome> GenesisWorkflowArgs<Ribosome>where
Ribosome: RibosomeT + 'static,
sourcepub fn new(
dna_file: DnaFile,
agent_pubkey: AgentPubKey,
membrane_proof: Option<MembraneProof>,
ribosome: Ribosome,
dht_db_cache: DhtDbQueryCache,
chc: Option<ChcImpl>
) -> GenesisWorkflowArgs<Ribosome>
pub fn new(
dna_file: DnaFile,
agent_pubkey: AgentPubKey,
membrane_proof: Option<MembraneProof>,
ribosome: Ribosome,
dht_db_cache: DhtDbQueryCache,
chc: Option<ChcImpl>
) -> GenesisWorkflowArgs<Ribosome>
Examples found in repository?
src/conductor/cell.rs (lines 196-203)
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
pub async fn genesis<Ribosome>(
id: CellId,
conductor_handle: ConductorHandle,
authored_db: DbWrite<DbKindAuthored>,
dht_db: DbWrite<DbKindDht>,
dht_db_cache: DhtDbQueryCache,
ribosome: Ribosome,
membrane_proof: Option<MembraneProof>,
chc: Option<ChcImpl>,
) -> CellResult<()>
where
Ribosome: RibosomeT + 'static,
{
// get the dna
let dna_file = conductor_handle
.get_dna_file(id.dna_hash())
.ok_or_else(|| DnaError::DnaMissing(id.dna_hash().to_owned()))?;
let conductor_api = CellConductorApi::new(conductor_handle.clone(), id.clone());
// run genesis
let workspace = GenesisWorkspace::new(authored_db, dht_db)
.map_err(ConductorApiError::from)
.map_err(Box::new)?;
// exit early if genesis has already run
if workspace.has_genesis(id.agent_pubkey().clone()).await? {
return Ok(());
}
let args = GenesisWorkflowArgs::new(
dna_file,
id.agent_pubkey().clone(),
membrane_proof,
ribosome,
dht_db_cache,
chc,
);
genesis_workflow(workspace, conductor_api, args)
.await
.map_err(ConductorApiError::from)
.map_err(Box::new)?;
if let Some(trigger) = conductor_handle
.get_queue_consumer_workflows()
.integration_trigger(Arc::new(id.dna_hash().clone()))
{
trigger.trigger(&"genesis");
}
Ok(())
}
Auto Trait Implementations§
impl<Ribosome> !RefUnwindSafe for GenesisWorkflowArgs<Ribosome>
impl<Ribosome> Send for GenesisWorkflowArgs<Ribosome>
impl<Ribosome> Sync for GenesisWorkflowArgs<Ribosome>
impl<Ribosome> Unpin for GenesisWorkflowArgs<Ribosome>where
Ribosome: Unpin,
impl<Ribosome> !UnwindSafe for GenesisWorkflowArgs<Ribosome>
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
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§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>
Deserializes using the given deserializer
§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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref