pub trait WorkerSource<Role, Worker, Plan>: Send{
type WorkerRejection: Send;
type SourceRejection: Send;
}Expand description
Static declaration implemented by one concrete Bombay worker-source capability.
This trait declares types only. It deliberately has no method: the source is
an affine capability interpreted by Bombay, not an application callback
invoked by FixedSupervisor.
A source declared for another worker cannot prepare this supervisor:
ⓘ
struct DeclaredWorker;
#[behavior::behavior(addr = behavior::MailAddr, message = behavior::Never)]
impl DeclaredWorker {
fn receive(&mut self, _: behavior::MailAddr, message: behavior::Never)
-> behavior::BehaviorActed<Self> {
match message {}
}
}
struct OtherWorker;
#[behavior::behavior(addr = behavior::MailAddr, message = behavior::Never)]
impl OtherWorker {
fn receive(&mut self, _: behavior::MailAddr, message: behavior::Never)
-> behavior::BehaviorActed<Self> {
match message {}
}
}
struct Source;
impl behavior_actors::atomic::WorkerSource<(), DeclaredWorker,
behavior_actors::atomic::ImmediateActivation> for Source
{
type WorkerRejection = behavior::Never;
type SourceRejection = behavior::Never;
}
fn requires_declared<Source>()
where
Source: behavior_actors::atomic::WorkerSource<
(), OtherWorker, behavior_actors::atomic::ImmediateActivation,
>,
{}
requires_declared::<Source>();Required Associated Types§
Sourcetype WorkerRejection: Send
type WorkerRejection: Send
Exact rejection while preparing one selected role.
Sourcetype SourceRejection: Send
type SourceRejection: Send
Exact rejection before the first worker submission is prepared.