pub struct EndpointAddress(/* private fields */);Expand description
An opaque, transport-interpreted address string (a queue name, a subject, a service name —
Reliar does not care which). Capped at Self::MAX_LEN bytes.
use reliar_core::EndpointAddress;
let address = EndpointAddress::parse("orders-service")?;
assert_eq!(address.as_str(), "orders-service");Implementations§
Source§impl EndpointAddress
impl EndpointAddress
Sourcepub fn parse(s: impl Into<String>) -> Result<Self, IdError>
pub fn parse(s: impl Into<String>) -> Result<Self, IdError>
Validates and wraps an endpoint address. Returns Err for an empty string, one
containing a control character (including CR/LF — a header-injection surface), or one
over Self::MAX_LEN bytes.
§Errors
Returns IdError::Empty, IdError::ControlCharacter, or IdError::TooLong.
use reliar_core::EndpointAddress;
let address = EndpointAddress::parse("orders-service")?;
assert_eq!(address.as_str(), "orders-service");
assert!(EndpointAddress::parse("").is_err());Trait Implementations§
Source§impl Clone for EndpointAddress
impl Clone for EndpointAddress
Source§fn clone(&self) -> EndpointAddress
fn clone(&self) -> EndpointAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EndpointAddress
impl Debug for EndpointAddress
Source§impl<'de> Deserialize<'de> for EndpointAddress
Available on crate feature serde only.
impl<'de> Deserialize<'de> for EndpointAddress
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EndpointAddress
impl Display for EndpointAddress
impl Eq for EndpointAddress
Source§impl Hash for EndpointAddress
impl Hash for EndpointAddress
Source§impl PartialEq for EndpointAddress
impl PartialEq for EndpointAddress
Source§impl Serialize for EndpointAddress
Available on crate feature serde only.
impl Serialize for EndpointAddress
Available on crate feature
serde only.impl StructuralPartialEq for EndpointAddress
Auto Trait Implementations§
impl Freeze for EndpointAddress
impl RefUnwindSafe for EndpointAddress
impl Send for EndpointAddress
impl Sync for EndpointAddress
impl Unpin for EndpointAddress
impl UnsafeUnpin for EndpointAddress
impl UnwindSafe for EndpointAddress
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