pub enum FixedCommand<A, Role, Service>{
Status {
reply_to: ReplyRoute<MessageProtocol<A, FixedSnapshot<Service>>>,
},
Capability {
role: Role,
reply_to: ReplyRoute<MessageProtocol<A, CapabilityResult<Role, Service>>>,
},
Shutdown,
}Expand description
Management input accepted by one fixed supervisor.
A recipient for another reply protocol cannot be substituted:
ⓘ
#[derive(Clone, Copy, Eq, PartialEq)]
struct RuntimeAddress;
impl behavior::Address for RuntimeAddress { type Nonce = u64; }
#[derive(Clone)]
struct Endpoint;
struct Installed<B: behavior::Behavior>(Endpoint, std::sync::mpsc::Sender<B::Event>);
impl<B: behavior::Behavior> Clone for Installed<B> {
fn clone(&self) -> Self { Self(self.0.clone(), self.1.clone()) }
}
impl behavior::EndpointAddress for RuntimeAddress {
type Established<P> = Endpoint where P: behavior::Protocol<Addr = Self>;
type Installed<B> = Installed<B>
where B: behavior::Behavior<Protocol: behavior::Protocol<Addr = Self>>;
fn recipient<B>(installed: &Self::Installed<B>) -> Endpoint
where B: behavior::Behavior<Protocol: behavior::Protocol<Addr = Self>> {
installed.0.clone()
}
}
struct Service;
impl behavior::Protocol for Service {
type Addr = RuntimeAddress;
type Msg = u8;
}
let wrong = behavior::Recipient::<
behavior::MessageProtocol<RuntimeAddress, u8>
>::global(RuntimeAddress);
let _: behavior_actors::atomic::FixedCommand<RuntimeAddress, u16, Service> =
behavior_actors::atomic::FixedCommand::status(wrong);Variants§
Status
Query every member status in declaration order.
Fields
§
reply_to: ReplyRoute<MessageProtocol<A, FixedSnapshot<Service>>>Temporary logical or exact status recipient.
Capability
Query the stable service capability for one semantic role.
Fields
§
role: RoleSubmitted role value, returned in every capability result.
§
reply_to: ReplyRoute<MessageProtocol<A, CapabilityResult<Role, Service>>>Temporary logical or exact capability-result recipient.
Shutdown
Close recovery admission and retire the complete owned actor graph.
Implementations§
Source§impl<A, Role, Service> FixedCommand<A, Role, Service>
impl<A, Role, Service> FixedCommand<A, Role, Service>
Sourcepub fn capability<Route>(role: Role, reply_to: Route) -> Self
pub fn capability<Route>(role: Role, reply_to: Route) -> Self
Construct one semantic-role capability query.
Auto Trait Implementations§
impl<A, Role, Service> Freeze for FixedCommand<A, Role, Service>where
Role: Freeze,
A: Freeze,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: Freeze,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: Freeze,
impl<A, Role, Service> RefUnwindSafe for FixedCommand<A, Role, Service>where
Role: RefUnwindSafe,
A: RefUnwindSafe,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: RefUnwindSafe,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: RefUnwindSafe,
impl<A, Role, Service> Send for FixedCommand<A, Role, Service>where
Role: Send,
A: Send,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: Send,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: Send,
impl<A, Role, Service> Sync for FixedCommand<A, Role, Service>where
Role: Sync,
A: Sync,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: Sync,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: Sync,
impl<A, Role, Service> Unpin for FixedCommand<A, Role, Service>where
Role: Unpin,
A: Unpin,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: Unpin,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: Unpin,
impl<A, Role, Service> UnsafeUnpin for FixedCommand<A, Role, Service>where
Role: UnsafeUnpin,
A: UnsafeUnpin,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: UnsafeUnpin,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: UnsafeUnpin,
impl<A, Role, Service> UnwindSafe for FixedCommand<A, Role, Service>where
Role: UnwindSafe,
A: UnwindSafe,
<A as EndpointAddress>::Established<MessageProtocol<A, FixedSnapshot<Service>>>: UnwindSafe,
<A as EndpointAddress>::Established<MessageProtocol<A, CapabilityResult<Role, Service>>>: UnwindSafe,
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
Mutably borrows from an owned value. Read more