Enum ockam_node::RouterReply
source · pub enum RouterReply {
Ok,
Workers(Vec<Address>),
Sender {
addr: Address,
sender: MessageSender<RelayMessage>,
},
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
§
sender: MessageSender<RelayMessage>
The relay sender
Message sender to a specific worker
State(bool)
Indicate the ‘ready’ state of an address
Implementations§
source§impl RouterReply
impl RouterReply
sourcepub fn ok() -> NodeReplyResult
pub fn ok() -> NodeReplyResult
Return RouterReply::Ok
sourcepub fn state(b: bool) -> NodeReplyResult
pub fn state(b: bool) -> NodeReplyResult
Return RouterReply::State
sourcepub fn no_such_address(a: Address) -> NodeReplyResult
pub fn no_such_address(a: Address) -> NodeReplyResult
Return NodeError::Address not found
sourcepub fn worker_exists(a: Address) -> NodeReplyResult
pub fn worker_exists(a: Address) -> NodeReplyResult
Return NodeError::Address already exists for the given address
sourcepub fn router_exists() -> NodeReplyResult
pub fn router_exists() -> NodeReplyResult
Return NodeError::RouterState already exists
sourcepub fn node_rejected(reason: NodeReason) -> NodeReplyResult
pub fn node_rejected(reason: NodeReason) -> NodeReplyResult
Return NodeError::NodeState conflict
sourcepub fn worker_rejected(reason: WorkerReason) -> NodeReplyResult
pub fn worker_rejected(reason: WorkerReason) -> NodeReplyResult
Return NodeError::WorkerState conflict
sourcepub fn workers(v: Vec<Address>) -> NodeReplyResult
pub fn workers(v: Vec<Address>) -> NodeReplyResult
Return RouterReply::Workers for the given addresses
sourcepub fn sender(
addr: Address,
sender: MessageSender<RelayMessage>
) -> NodeReplyResult
pub fn sender( addr: Address, sender: MessageSender<RelayMessage> ) -> NodeReplyResult
Return RouterReply::Sender for the given information
sourcepub fn take_sender(self) -> Result<(Address, MessageSender<RelayMessage>)>
pub fn take_sender(self) -> Result<(Address, MessageSender<RelayMessage>)>
Consume the wrapper and return RouterReply::Sender
sourcepub fn take_workers(self) -> Result<Vec<Address>>
pub fn take_workers(self) -> Result<Vec<Address>>
Consume the wrapper and return RouterReply::Workers
sourcepub fn take_state(self) -> Result<bool>
pub fn take_state(self) -> Result<bool>
Consume the wrapper and return RouterReply::State
sourcepub fn is_ok(self) -> Result<()>
pub fn is_ok(self) -> Result<()>
Returns Ok if self is RouterReply::Ok
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§
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