pub struct ProcessLocation { /* private fields */ }Expand description
Location metadata used for topology-aware routing.
Implementations§
Source§impl ProcessLocation
impl ProcessLocation
Sourcepub fn new(hostname: impl Into<String>) -> Result<Self>
pub fn new(hostname: impl Into<String>) -> Result<Self>
Creates a validated location with hostname only.
Hostname validation rules:
- non-empty
- max 253 characters
- first character is ASCII letter or digit
- remaining characters are ASCII letters, digits,
-,., or_
Hostnames are normalized to lowercase for stable scope comparison.
Sourcepub fn with_ids(
hostname: impl Into<String>,
node_id: Option<u32>,
device_id: Option<u32>,
) -> Result<Self>
pub fn with_ids( hostname: impl Into<String>, node_id: Option<u32>, device_id: Option<u32>, ) -> Result<Self>
Creates a validated location with hostname plus optional node/device metadata.
Sourcepub fn from_hostname() -> Result<Self>
pub fn from_hostname() -> Result<Self>
Detects the local hostname via OS APIs and returns a location.
Returns an error if hostname detection fails.
Trait Implementations§
Source§impl Clone for ProcessLocation
impl Clone for ProcessLocation
Source§fn clone(&self) -> ProcessLocation
fn clone(&self) -> ProcessLocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProcessLocation
impl Debug for ProcessLocation
Source§impl<'de> Deserialize<'de> for ProcessLocation
impl<'de> Deserialize<'de> for ProcessLocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProcessLocation
impl PartialEq for ProcessLocation
Source§impl Serialize for ProcessLocation
impl Serialize for ProcessLocation
impl Eq for ProcessLocation
impl StructuralPartialEq for ProcessLocation
Auto Trait Implementations§
impl Freeze for ProcessLocation
impl RefUnwindSafe for ProcessLocation
impl Send for ProcessLocation
impl Sync for ProcessLocation
impl Unpin for ProcessLocation
impl UnsafeUnpin for ProcessLocation
impl UnwindSafe for ProcessLocation
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