Skip to main content

FixedCommand

Enum FixedCommand 

Source
pub enum FixedCommand<A, Role, Service>
where A: Address + EndpointAddress, Service: Protocol<Addr = A>,
{ 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: Role

Submitted 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>
where A: Address + EndpointAddress, Service: Protocol<Addr = A>,

Source

pub fn status<Route>(reply_to: Route) -> Self
where Route: Into<ReplyRoute<MessageProtocol<A, FixedSnapshot<Service>>>>,

Construct a declaration-ordered status query.

Source

pub fn capability<Route>(role: Role, reply_to: Route) -> Self
where Route: Into<ReplyRoute<MessageProtocol<A, CapabilityResult<Role, Service>>>>,

Construct one semantic-role capability query.

Source

pub const fn shutdown() -> Self

Construct shutdown without a reply placeholder.

Auto Trait Implementations§

§

impl<A, Role, Service> Freeze for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> RefUnwindSafe for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> Send for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> Sync for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> Unpin for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> UnsafeUnpin for FixedCommand<A, Role, Service>

§

impl<A, Role, Service> UnwindSafe for FixedCommand<A, Role, Service>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.