Struct ServiceDocument
pub struct ServiceDocument {
pub version: u32,
pub server_name: String,
pub directory: String,
pub relay: String,
pub accounts: String,
pub provisioning: String,
pub tls: Tls,
pub ws: Option<String>,
}Expand description
The document itself. The four services are host:port strings, resolved
by the reader; server_name is the name the TLS certificate presents,
which is the host in every deployment so far but is carried separately so
that it need not be.
Fields§
§version: u32The document’s own format version; see [VERSION].
server_name: StringThe name the server’s TLS certificate presents.
directory: StringThe directory service, as host:port.
relay: StringThe relay, as host:port.
accounts: StringThe account service, as host:port.
provisioning: StringThe provisioning service, as host:port.
tls: TlsHow to trust the server.
ws: Option<String>The WebSocket base URL, if the deployment offers one; see the module documentation. Absent from documents written before it existed.
Implementations§
§impl ServiceDocument
impl ServiceDocument
pub fn hosted(host: &str) -> ServiceDocument
pub fn hosted(host: &str) -> ServiceDocument
The four services on host, on the default ports, over web-PKI TLS
presenting host: a hosted deployment.
pub fn local(host: &str) -> ServiceDocument
pub fn local(host: &str) -> ServiceDocument
The four services on host, on the default ports, without TLS: a
development server on loopback.
pub fn on(
host: &str,
server_name: &str,
ports: [u16; 4],
tls: Tls,
) -> ServiceDocument
pub fn on( host: &str, server_name: &str, ports: [u16; 4], tls: Tls, ) -> ServiceDocument
The four services on host at ports (directory, relay, accounts,
provisioning), trusted as tls under server_name.
pub fn with_ws(self, ws: &str) -> ServiceDocument
pub fn with_ws(self, ws: &str) -> ServiceDocument
The same document, offering the WebSocket carriage at ws (a base
URL such as wss://tacenta.com/v1/ws, without a trailing slash).
Trait Implementations§
§impl Clone for ServiceDocument
impl Clone for ServiceDocument
§fn clone(&self) -> ServiceDocument
fn clone(&self) -> ServiceDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more