pub struct Address {
pub node: NodeId,
pub process: ProcessId,
}
Fields§
§node: NodeId
§process: ProcessId
Implementations§
Source§impl Address
Address is defined in hyperware.wit
, but constructors and methods here.
An Address is a combination of a node ID (string) and a ProcessId
. It is
used in the Request
/crate::Response
pattern to indicate which process on a given node
in the network to direct the message to. The formatting structure for
an Address is node@process_name:package_name:publisher_node
impl Address
Address is defined in hyperware.wit
, but constructors and methods here.
An Address is a combination of a node ID (string) and a ProcessId
. It is
used in the Request
/crate::Response
pattern to indicate which process on a given node
in the network to direct the message to. The formatting structure for
an Address is node@process_name:package_name:publisher_node
Sourcepub fn new<T, U>(node: T, process: U) -> Address
pub fn new<T, U>(node: T, process: U) -> Address
Create a new Address
. Takes a node ID and a process ID.
Sourcepub fn publisher(&self) -> &str
pub fn publisher(&self) -> &str
Read the publisher node ID from an Address
. Note that Address
segments are not parsed for validity, and a node ID stored here is
not guaranteed to be a valid ID in the name system, or be connected
to an identity at all.
Sourcepub fn package_id(&self) -> PackageId
pub fn package_id(&self) -> PackageId
Read the package_id (package + publisher) from an Address
.
Sourcepub fn send_request(&self) -> Request
pub fn send_request(&self) -> Request
Send a Request
to Address
.
Trait Implementations§
Source§impl<'a> Deserialize<'a> for Address
impl<'a> Deserialize<'a> for Address
Source§fn deserialize<D>(deserializer: D) -> Result<Address, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Address, D::Error>where
D: Deserializer<'a>,
Source§impl<T, U, V, W> From<(T, U, V, W)> for Address
impl<T, U, V, W> From<(T, U, V, W)> for Address
Source§fn from(input: (T, U, V, W)) -> Self
fn from(input: (T, U, V, W)) -> Self
Source§impl FromStr for Address
impl FromStr for Address
Source§fn from_str(input: &str) -> Result<Self, AddressParseError>
fn from_str(input: &str) -> Result<Self, AddressParseError>
Attempt to parse an Address
from a string. The formatting structure for
an Address is node@process_name:package_name:publisher_node
.
The string being parsed must contain exactly one @
and three :
characters.
The @
character separates the node ID from the rest of the address, and the
:
characters separate the process name, package name, and publisher node ID.
Source§type Err = AddressParseError
type Err = AddressParseError
impl Eq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.