Enum ockam_node::RouterReply
source · [−]pub enum RouterReply {
Ok,
Workers(Vec<Address>),
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>)
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 RouterReply
impl RouterReply
sourcepub fn ok() -> NodeReplyResult
pub fn ok() -> NodeReplyResult
Return [NodeReply::Ok]
sourcepub fn state(b: bool) -> NodeReplyResult
pub fn state(b: bool) -> NodeReplyResult
Return [NodeReply::State]
sourcepub fn no_such_address(a: Address) -> NodeReplyResult
pub fn no_such_address(a: Address) -> NodeReplyResult
Return [NodeError::NoSuchAddress]
sourcepub fn worker_exists(a: Address) -> NodeReplyResult
pub fn worker_exists(a: Address) -> NodeReplyResult
Return [NodeError::WorkerExists] for the given address
sourcepub fn router_exists() -> NodeReplyResult
pub fn router_exists() -> NodeReplyResult
Return [NodeError::RouterExists]
sourcepub fn node_rejected(reason: NodeReason) -> NodeReplyResult
pub fn node_rejected(reason: NodeReason) -> NodeReplyResult
Return [NodeReply::Rejected(reason)]
sourcepub fn worker_rejected(reason: WorkerReason) -> NodeReplyResult
pub fn worker_rejected(reason: WorkerReason) -> NodeReplyResult
Return [NodeReply::Rejected(reason)]
sourcepub fn workers(v: Vec<Address>) -> NodeReplyResult
pub fn workers(v: Vec<Address>) -> NodeReplyResult
Return [NodeReply::Workers] for the given addresses
sourcepub fn sender(
addr: Address,
sender: Sender<RelayMessage>,
wrap: bool
) -> NodeReplyResult
pub fn sender(
addr: Address,
sender: Sender<RelayMessage>,
wrap: bool
) -> NodeReplyResult
Return [NodeReply::Sender] for the given information
sourcepub fn take_sender(self) -> Result<(Address, Sender<RelayMessage>, bool)>
pub fn take_sender(self) -> Result<(Address, Sender<RelayMessage>, bool)>
Consume the wrapper and return [NodeReply::Sender]
sourcepub fn take_workers(self) -> Result<Vec<Address>>
pub fn take_workers(self) -> Result<Vec<Address>>
Consume the wrapper and return [NodeReply::Workers]
sourcepub fn take_state(self) -> Result<bool>
pub fn take_state(self) -> Result<bool>
Consume the wrapper and return [NodeReply::State]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RouterReply
impl Send for RouterReply
impl Sync for RouterReply
impl Unpin for RouterReply
impl !UnwindSafe for RouterReply
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>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more