pub struct ServerDocument {
pub endpoint_id: String,
pub name: String,
pub addrs: Vec<String>,
pub relays: Vec<String>,
pub lookup: Option<String>,
}Expand description
What a server says of itself at PATH.
Fields§
§endpoint_id: StringThe server’s EndpointId, hex: the key a device dials.
name: StringWhat the server calls itself.
addrs: Vec<String>Addresses it may be reached at, ip:port.
relays: Vec<String>The URLs of relays it may be reached through.
lookup: Option<String>The pkarr relay it publishes where it is to.
Implementations§
Source§impl ServerDocument
impl ServerDocument
Sourcepub fn of(invite: &Invite) -> Self
pub fn of(invite: &Invite) -> Self
The document of a server whose invite link (with no code) is
invite: the same key, name, addresses, relays and lookup.
Sourcepub fn socket_addrs(&self) -> Vec<SocketAddr>
pub fn socket_addrs(&self) -> Vec<SocketAddr>
The addresses that read as ip:port, each once, at most
MAX_HINTS; the rest are left out.
Sourcepub fn relay_urls(&self) -> Vec<String>
pub fn relay_urls(&self) -> Vec<String>
The relays that are plain http(s) URLs, each once, at most
MAX_HINTS, as an invite link’s are read.
Sourcepub fn lookup_url(&self) -> Option<String>
pub fn lookup_url(&self) -> Option<String>
The lookup, if it is a plain http(s) URL.
Trait Implementations§
Source§impl Clone for ServerDocument
impl Clone for ServerDocument
Source§impl Debug for ServerDocument
impl Debug for ServerDocument
Source§impl<'de> Deserialize<'de> for ServerDocument
impl<'de> Deserialize<'de> for ServerDocument
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 ServerDocument
Source§impl PartialEq for ServerDocument
impl PartialEq for ServerDocument
Source§impl Serialize for ServerDocument
impl Serialize for ServerDocument
impl StructuralPartialEq for ServerDocument
Auto Trait Implementations§
impl Forget for ServerDocument
impl Freeze for ServerDocument
impl Move for ServerDocument
impl RefUnwindSafe for ServerDocument
impl Send for ServerDocument
impl Sync for ServerDocument
impl Unpin for ServerDocument
impl UnsafeUnpin for ServerDocument
impl UnwindSafe for ServerDocument
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