Enum ockam_node::NodeReply
source · [−]pub enum NodeReply {
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 NodeReply
impl NodeReply
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::NoSuchWorker]
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 rejected(reason: Reason) -> NodeReplyResult
pub fn rejected(reason: Reason) -> 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), 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>, Error>
pub fn take_workers(self) -> Result<Vec<Address>, 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>
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