pub struct DeployFlow<'a, D>where
D: Deploy<'a>,{ /* private fields */ }build only.Implementations§
Source§impl<'a, D: Deploy<'a>> DeployFlow<'a, D>
impl<'a, D: Deploy<'a>> DeployFlow<'a, D>
pub fn ir(&self) -> &Vec<HydroRoot>
pub fn with_process<P>( self, process: &Process<'_, P>, spec: impl IntoProcessSpec<'a, D>, ) -> Self
pub fn with_remaining_processes<S: IntoProcessSpec<'a, D> + 'a>( self, spec: impl Fn() -> S, ) -> Self
pub fn with_cluster<C>( self, cluster: &Cluster<'_, C>, spec: impl ClusterSpec<'a, D>, ) -> Self
pub fn with_remaining_clusters<S: ClusterSpec<'a, D> + 'a>( self, spec: impl Fn() -> S, ) -> Self
pub fn with_external<P>( self, external: &External<'_, P>, spec: impl ExternalSpec<'a, D>, ) -> Self
pub fn with_remaining_externals<S: ExternalSpec<'a, D> + 'a>( self, spec: impl Fn() -> S, ) -> Self
Sourcepub fn with_sidecar_all(self, sidecar: &impl Sidecar) -> Self
pub fn with_sidecar_all(self, sidecar: &impl Sidecar) -> Self
Adds a Sidecar to all processes and clusters in the flow.
Sourcepub fn with_sidecar_internal(
self,
location_key: LocationKey,
sidecar: &impl Sidecar,
) -> Self
pub fn with_sidecar_internal( self, location_key: LocationKey, sidecar: &impl Sidecar, ) -> Self
Adds a Sidecar to the given location.
Sourcepub fn with_sidecar_process(
self,
process: &Process<'_, ()>,
sidecar: &impl Sidecar,
) -> Self
pub fn with_sidecar_process( self, process: &Process<'_, ()>, sidecar: &impl Sidecar, ) -> Self
Adds a Sidecar to a specific process in the flow.
Sourcepub fn with_sidecar_cluster(
self,
cluster: &Cluster<'_, ()>,
sidecar: &impl Sidecar,
) -> Self
pub fn with_sidecar_cluster( self, cluster: &Cluster<'_, ()>, sidecar: &impl Sidecar, ) -> Self
Adds a Sidecar to a specific cluster in the flow.
Sourcepub fn preview_compile(&mut self) -> CompiledFlow<'a>
pub fn preview_compile(&mut self) -> CompiledFlow<'a>
Compiles the flow into DFIR (dfir_lang::graph::DfirGraph) without networking.
Useful for generating Mermaid diagrams of the DFIR.
(This returned DFIR will not compile due to the networking missing).
Sourcepub fn compile(self) -> CompiledFlow<'a>
pub fn compile(self) -> CompiledFlow<'a>
Compiles the flow into DFIR (dfir_lang::graph::DfirGraph) including networking.
(This does not compile the DFIR itself, instead use Self::deploy to compile & deploy the DFIR).
Sourcepub fn deploy(self, env: &mut D::InstantiateEnv) -> DeployResult<'a, D>
pub fn deploy(self, env: &mut D::InstantiateEnv) -> DeployResult<'a, D>
Compiles and deploys the flow.
Rough outline of steps:
- Compiles the Hydro into DFIR.
- Instantiates nodes as configured.
- Compiles the corresponding DFIR into binaries for nodes as needed.
- Connects up networking as needed.
Source§impl DeployFlow<'_, EmbeddedDeploy>
impl DeployFlow<'_, EmbeddedDeploy>
Sourcepub fn generate_embedded(self, crate_name: &str) -> File
pub fn generate_embedded(self, crate_name: &str) -> File
Generates a syn::File containing one function per location in the flow.
Each generated function has the signature:
pub fn <fn_name>() -> dfir_rs::scheduled::graph::Dfir<'static>where fn_name is the String passed to with_process / with_cluster.
The returned Dfir can be manually executed by the caller.
§Arguments
crate_name— the name of the crate containing the Hydro program (used for stageleft re-exports). Hyphens will be replaced with underscores.
§Usage
Typically called from a build.rs in a wrapper crate:
// build.rs
let deploy = flow.with_process(&process, "my_fn".to_string());
let code = deploy.generate_embedded("my_hydro_crate");
let out_dir = std::env::var("OUT_DIR").unwrap();
std::fs::write(format!("{out_dir}/embedded.rs"), prettyplease::unparse(&code)).unwrap();Then in lib.rs:
include!(concat!(env!("OUT_DIR"), "/embedded.rs"));Auto Trait Implementations§
impl<'a, D> Freeze for DeployFlow<'a, D>
impl<'a, D> !RefUnwindSafe for DeployFlow<'a, D>
impl<'a, D> !Send for DeployFlow<'a, D>
impl<'a, D> !Sync for DeployFlow<'a, D>
impl<'a, D> Unpin for DeployFlow<'a, D>
impl<'a, D> !UnwindSafe for DeployFlow<'a, D>
Blanket Implementations§
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more