pub struct Endpoint { /* private fields */ }Expand description
Network endpoint for contacting an agent.
Represents a reachable address where an agent can be contacted. Multiple endpoints may be provided for redundancy or protocol flexibility.
§Examples
use agent_uri_dht::Endpoint;
let https = Endpoint::new("https", "agent.example.com:443", Some("/v1/agent"));
let grpc = Endpoint::new("grpc", "agent.example.com:50051", None::<&str>);Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn new(
protocol: impl Into<String>,
address: impl Into<String>,
path: Option<impl Into<String>>,
) -> Self
pub fn new( protocol: impl Into<String>, address: impl Into<String>, path: Option<impl Into<String>>, ) -> Self
Creates a new endpoint.
§Arguments
protocol- Transport protocol (e.g., “https”, “grpc”, “ws”)address- Host and optional port (e.g., “example.com:443”)path- Optional path prefix (e.g., “/v1/agent”)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Endpoint
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Endpoint
Available on crate feature
serde only.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 Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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