pub enum NodeReply {
Ok,
Workers(Vec<Address, Global>),
Sender {
addr: Address,
sender: Sender<RelayMessage>,
wrap: bool,
},
State(bool),
}
Expand description
Successful return values from a router command
Variants
Ok
Success with no payload
Workers(Vec<Address, Global>)
A list of worker addresses
Sender
Fields
addr: Address
The address a message is being sent to
sender: Sender<RelayMessage>
The relay sender
wrap: bool
Indicate whether the relay message needs to be constructed with router wrapping.
Message sender to a specific worker
State(bool)
Indicate the ‘ready’ state of an address
Implementations
sourceimpl NodeReply
impl NodeReply
sourcepub fn no_such_address(a: Address) -> Result<NodeReply, NodeError>
pub fn no_such_address(a: Address) -> Result<NodeReply, NodeError>
Return [NodeError::NoSuchWorker]
sourcepub fn worker_exists(a: Address) -> Result<NodeReply, NodeError>
pub fn worker_exists(a: Address) -> Result<NodeReply, NodeError>
Return NodeError::WorkerExists for the given address
sourcepub fn router_exists() -> Result<NodeReply, NodeError>
pub fn router_exists() -> Result<NodeReply, NodeError>
Return NodeError::RouterExists
sourcepub fn rejected(reason: Reason) -> Result<NodeReply, NodeError>
pub fn rejected(reason: Reason) -> Result<NodeReply, NodeError>
Return [NodeReply::Rejected(reason)]
sourcepub fn workers(v: Vec<Address, Global>) -> Result<NodeReply, NodeError>
pub fn workers(v: Vec<Address, Global>) -> Result<NodeReply, NodeError>
Return NodeReply::Workers for the given addresses
sourcepub fn sender(
addr: Address,
sender: Sender<RelayMessage>,
wrap: bool
) -> Result<NodeReply, NodeError>
pub fn sender(
addr: Address,
sender: Sender<RelayMessage>,
wrap: bool
) -> Result<NodeReply, NodeError>
Return NodeReply::Sender for the given information
sourcepub fn take_sender(self) -> Result<(Address, Sender<RelayMessage>, bool), Error>
pub fn take_sender(self) -> Result<(Address, Sender<RelayMessage>, bool), Error>
Consume the wrapper and return NodeReply::Sender
sourcepub fn take_workers(self) -> Result<Vec<Address, Global>, Error>
pub fn take_workers(self) -> Result<Vec<Address, Global>, Error>
Consume the wrapper and return NodeReply::Workers
sourcepub fn take_state(self) -> Result<bool, Error>
pub fn take_state(self) -> Result<bool, Error>
Consume the wrapper and return NodeReply::State
sourcepub fn is_ok(self) -> Result<(), Error>
pub fn is_ok(self) -> Result<(), Error>
Returns Ok if self is NodeReply::Ok
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for NodeReply
impl Send for NodeReply
impl Sync for NodeReply
impl Unpin for NodeReply
impl !UnwindSafe for NodeReply
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more