pub trait Deploy<'a> {
type Meta: Default;
type InstantiateEnv;
type Process: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + Clone;
type Cluster: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + Clone;
type External: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + RegisterPort<'a, Self>;
Show 18 methods
// Required methods
fn o2o_sink_source(
env: &mut Self::InstantiateEnv,
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr);
fn o2o_connect(
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
) -> Box<dyn FnOnce()>;
fn o2m_sink_source(
env: &mut Self::InstantiateEnv,
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr);
fn o2m_connect(
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
) -> Box<dyn FnOnce()>;
fn m2o_sink_source(
env: &mut Self::InstantiateEnv,
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr);
fn m2o_connect(
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
) -> Box<dyn FnOnce()>;
fn m2m_sink_source(
env: &mut Self::InstantiateEnv,
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr);
fn m2m_connect(
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
) -> Box<dyn FnOnce()>;
fn e2o_many_source(
extra_stmts: &mut Vec<Stmt>,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
codec_type: &Type,
shared_handle: String,
) -> Expr;
fn e2o_many_sink(shared_handle: String) -> Expr;
fn e2o_source(
extra_stmts: &mut Vec<Stmt>,
p1: &Self::External,
p1_port: &<Self::External as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
codec_type: &Type,
shared_handle: String,
) -> Expr;
fn e2o_connect(
p1: &Self::External,
p1_port: &<Self::External as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
many: bool,
server_hint: NetworkHint,
) -> Box<dyn FnOnce()>;
fn o2e_sink(
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
p2: &Self::External,
p2_port: &<Self::External as Node>::Port,
shared_handle: String,
) -> Expr;
fn cluster_ids(
of_cluster: LocationKey,
) -> impl QuotedWithContext<'a, &'a [TaglessMemberId], ()> + Clone + 'a;
fn cluster_self_id( ) -> impl QuotedWithContext<'a, TaglessMemberId, ()> + Clone + 'a;
fn cluster_membership_stream(
env: &mut Self::InstantiateEnv,
at_location: &LocationId,
location_id: &LocationId,
) -> impl QuotedWithContext<'a, Box<dyn Stream<Item = (TaglessMemberId, MembershipEvent)> + Unpin>, ()>;
// Provided methods
fn register_embedded_input(
_env: &mut Self::InstantiateEnv,
_location_key: LocationKey,
_ident: &Ident,
_element_type: &Type,
) { ... }
fn register_embedded_output(
_env: &mut Self::InstantiateEnv,
_location_key: LocationKey,
_ident: &Ident,
_element_type: &Type,
) { ... }
}build only.Required Associated Types§
type Meta: Default
type InstantiateEnv
type Process: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + Clone
type Cluster: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + Clone
type External: Node<Meta = Self::Meta, InstantiateEnv = Self::InstantiateEnv> + RegisterPort<'a, Self>
Required Methods§
Sourcefn o2o_sink_source(
env: &mut Self::InstantiateEnv,
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr)
fn o2o_sink_source( env: &mut Self::InstantiateEnv, p1: &Self::Process, p1_port: &<Self::Process as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, name: Option<&str>, ) -> (Expr, Expr)
Generates the source and sink expressions when connecting a Self::Process to another
Self::Process.
The Self::InstantiateEnv can be used to record metadata about the created channel. The
provided name is the user-configured channel name from the network IR node.
Sourcefn o2o_connect(
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
) -> Box<dyn FnOnce()>
fn o2o_connect( p1: &Self::Process, p1_port: &<Self::Process as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, ) -> Box<dyn FnOnce()>
Performs any runtime wiring needed after code generation for a
Self::Process-to-Self::Process channel.
The returned closure is executed once all locations have been instantiated.
Sourcefn o2m_sink_source(
env: &mut Self::InstantiateEnv,
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr)
fn o2m_sink_source( env: &mut Self::InstantiateEnv, p1: &Self::Process, p1_port: &<Self::Process as Node>::Port, c2: &Self::Cluster, c2_port: &<Self::Cluster as Node>::Port, name: Option<&str>, ) -> (Expr, Expr)
Generates the source and sink expressions when connecting a Self::Process to a
Self::Cluster (one-to-many).
The sink expression is used on the sending process and the source expression on each
receiving cluster member. The Self::InstantiateEnv can be used to record metadata
about the created channel. The provided name is the user-configured channel name
from the network IR node.
Sourcefn o2m_connect(
p1: &Self::Process,
p1_port: &<Self::Process as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
) -> Box<dyn FnOnce()>
fn o2m_connect( p1: &Self::Process, p1_port: &<Self::Process as Node>::Port, c2: &Self::Cluster, c2_port: &<Self::Cluster as Node>::Port, ) -> Box<dyn FnOnce()>
Performs any runtime wiring needed after code generation for a
Self::Process-to-Self::Cluster channel.
The returned closure is executed once all locations have been instantiated.
Sourcefn m2o_sink_source(
env: &mut Self::InstantiateEnv,
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr)
fn m2o_sink_source( env: &mut Self::InstantiateEnv, c1: &Self::Cluster, c1_port: &<Self::Cluster as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, name: Option<&str>, ) -> (Expr, Expr)
Generates the source and sink expressions when connecting a Self::Cluster to a
Self::Process (many-to-one).
The sink expression is used on each sending cluster member and the source expression
on the receiving process. The Self::InstantiateEnv can be used to record metadata
about the created channel. The provided name is the user-configured channel name
from the network IR node.
Sourcefn m2o_connect(
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
p2: &Self::Process,
p2_port: &<Self::Process as Node>::Port,
) -> Box<dyn FnOnce()>
fn m2o_connect( c1: &Self::Cluster, c1_port: &<Self::Cluster as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, ) -> Box<dyn FnOnce()>
Performs any runtime wiring needed after code generation for a
Self::Cluster-to-Self::Process channel.
The returned closure is executed once all locations have been instantiated.
Sourcefn m2m_sink_source(
env: &mut Self::InstantiateEnv,
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
name: Option<&str>,
) -> (Expr, Expr)
fn m2m_sink_source( env: &mut Self::InstantiateEnv, c1: &Self::Cluster, c1_port: &<Self::Cluster as Node>::Port, c2: &Self::Cluster, c2_port: &<Self::Cluster as Node>::Port, name: Option<&str>, ) -> (Expr, Expr)
Generates the source and sink expressions when connecting a Self::Cluster to another
Self::Cluster (many-to-many).
The sink expression is used on each sending cluster member and the source expression
on each receiving cluster member. The Self::InstantiateEnv can be used to record
metadata about the created channel. The provided name is the user-configured channel
name from the network IR node.
Sourcefn m2m_connect(
c1: &Self::Cluster,
c1_port: &<Self::Cluster as Node>::Port,
c2: &Self::Cluster,
c2_port: &<Self::Cluster as Node>::Port,
) -> Box<dyn FnOnce()>
fn m2m_connect( c1: &Self::Cluster, c1_port: &<Self::Cluster as Node>::Port, c2: &Self::Cluster, c2_port: &<Self::Cluster as Node>::Port, ) -> Box<dyn FnOnce()>
Performs any runtime wiring needed after code generation for a
Self::Cluster-to-Self::Cluster channel.
The returned closure is executed once all locations have been instantiated.
fn e2o_many_source( extra_stmts: &mut Vec<Stmt>, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, codec_type: &Type, shared_handle: String, ) -> Expr
fn e2o_many_sink(shared_handle: String) -> Expr
fn e2o_source( extra_stmts: &mut Vec<Stmt>, p1: &Self::External, p1_port: &<Self::External as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, codec_type: &Type, shared_handle: String, ) -> Expr
fn e2o_connect( p1: &Self::External, p1_port: &<Self::External as Node>::Port, p2: &Self::Process, p2_port: &<Self::Process as Node>::Port, many: bool, server_hint: NetworkHint, ) -> Box<dyn FnOnce()>
fn o2e_sink( p1: &Self::Process, p1_port: &<Self::Process as Node>::Port, p2: &Self::External, p2_port: &<Self::External as Node>::Port, shared_handle: String, ) -> Expr
fn cluster_ids( of_cluster: LocationKey, ) -> impl QuotedWithContext<'a, &'a [TaglessMemberId], ()> + Clone + 'a
fn cluster_self_id() -> impl QuotedWithContext<'a, TaglessMemberId, ()> + Clone + 'a
fn cluster_membership_stream( env: &mut Self::InstantiateEnv, at_location: &LocationId, location_id: &LocationId, ) -> impl QuotedWithContext<'a, Box<dyn Stream<Item = (TaglessMemberId, MembershipEvent)> + Unpin>, ()>
Provided Methods§
Sourcefn register_embedded_input(
_env: &mut Self::InstantiateEnv,
_location_key: LocationKey,
_ident: &Ident,
_element_type: &Type,
)
fn register_embedded_input( _env: &mut Self::InstantiateEnv, _location_key: LocationKey, _ident: &Ident, _element_type: &Type, )
Registers an embedded input for the given ident and element type.
Only meaningful for the embedded deployment backend. The default implementation panics.
Sourcefn register_embedded_output(
_env: &mut Self::InstantiateEnv,
_location_key: LocationKey,
_ident: &Ident,
_element_type: &Type,
)
fn register_embedded_output( _env: &mut Self::InstantiateEnv, _location_key: LocationKey, _ident: &Ident, _element_type: &Type, )
Registers an embedded output for the given ident and element type.
Only meaningful for the embedded deployment backend. The default implementation panics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<'a> Deploy<'a> for HydroDeploy
Available on crate feature deploy only.
impl<'a> Deploy<'a> for HydroDeploy
deploy only.type Meta = SparseSecondaryMap<LocationKey, Vec<TaglessMemberId>>
type InstantiateEnv = Deployment
type Process = DeployNode
type Cluster = DeployCluster
type External = DeployExternal
Source§impl<'a> Deploy<'a> for MaelstromDeploy
Available on crate features maelstrom and deploy only.
impl<'a> Deploy<'a> for MaelstromDeploy
maelstrom and deploy only.type Meta = ()
type InstantiateEnv = MaelstromDeployment
type Process = MaelstromProcess
type Cluster = MaelstromCluster
type External = MaelstromExternal
Source§impl<'a> Deploy<'a> for EmbeddedDeploy
impl<'a> Deploy<'a> for EmbeddedDeploy
type Meta = ()
type InstantiateEnv = EmbeddedInstantiateEnv
type Process = EmbeddedNode
type Cluster = EmbeddedNode
type External = EmbeddedNode
Source§impl<'a> Deploy<'a> for DockerDeploy
Available on crate features docker_deploy and deploy only.
impl<'a> Deploy<'a> for DockerDeploy
docker_deploy and deploy only.