pub struct EndpointIdentity {
pub host: String,
pub local: bool,
}Expand description
A non-secret identity for the endpoint a route talks to.
Deliberately not a base URL: a configured base URL can carry a token in its path or query, and receipts are durable. Host plus a coarse path label is enough to tell two deployments apart, which is the only thing this is for.
Fields§
§host: StringHost (and port, when non-default), lowercased. Never credentials.
local: boolWhether the endpoint resolves to loopback / a private address.
Implementations§
Source§impl EndpointIdentity
impl EndpointIdentity
Sourcepub fn from_base_url(base_url: &str) -> Self
pub fn from_base_url(base_url: &str) -> Self
Build an endpoint identity from a base URL, keeping only the host.
Parsing is deliberately minimal and dependency-free: strip the scheme,
drop anything before an @ (which is exactly where a credential would
live), then keep the authority up to the first /.
Trait Implementations§
Source§impl Clone for EndpointIdentity
impl Clone for EndpointIdentity
Source§fn clone(&self) -> EndpointIdentity
fn clone(&self) -> EndpointIdentity
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 EndpointIdentity
impl Debug for EndpointIdentity
Source§impl<'de> Deserialize<'de> for EndpointIdentity
impl<'de> Deserialize<'de> for EndpointIdentity
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
impl Eq for EndpointIdentity
Source§impl PartialEq for EndpointIdentity
impl PartialEq for EndpointIdentity
Source§impl Serialize for EndpointIdentity
impl Serialize for EndpointIdentity
impl StructuralPartialEq for EndpointIdentity
Auto Trait Implementations§
impl Freeze for EndpointIdentity
impl RefUnwindSafe for EndpointIdentity
impl Send for EndpointIdentity
impl Sync for EndpointIdentity
impl Unpin for EndpointIdentity
impl UnsafeUnpin for EndpointIdentity
impl UnwindSafe for EndpointIdentity
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