pub struct ServeState {
pub name: String,
pub ports: BTreeMap<u16, ServeTarget>,
}Expand description
A complete multi-port Serve configuration for one node (mirrors upstream ipn.ServeConfig’s
per-port TCP map). Stored on the device and reconciled into one accept loop per port by the
Serve runtime; set_serve_config REPLACES the whole config (Go semantics).
All TLS-terminating ports share the node’s single MagicDNS name
certificate (obtained via the ACME path). TcpForward ports need no cert.
Fields§
§name: StringThe node’s MagicDNS name the TLS-terminating ports’ certificate is for (e.g.
host.tailnet.ts.net). Must be a tailnet name when any TLS-terminating port is configured.
ports: BTreeMap<u16, ServeTarget>Map of tailnet (overlay) port → what to serve on it.
Implementations§
Source§impl ServeState
impl ServeState
Sourcepub fn validate(&self) -> Result<(), CertError>
pub fn validate(&self) -> Result<(), CertError>
Validate the whole config. Fail-closed: rejects port 0, empty proxy/forward targets, and —
when any TLS-terminating port is present — a non-tailnet name (anti-leak: we never mint a
cert for an off-tailnet name). An empty config (no ports) is valid (serves nothing).
Trait Implementations§
Source§impl Clone for ServeState
impl Clone for ServeState
Source§fn clone(&self) -> ServeState
fn clone(&self) -> ServeState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServeState
impl Debug for ServeState
Source§impl Default for ServeState
impl Default for ServeState
Source§fn default() -> ServeState
fn default() -> ServeState
Source§impl<'de> Deserialize<'de> for ServeState
impl<'de> Deserialize<'de> for ServeState
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>,
impl Eq for ServeState
Source§impl PartialEq for ServeState
impl PartialEq for ServeState
Source§fn eq(&self, other: &ServeState) -> bool
fn eq(&self, other: &ServeState) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ServeState
impl Serialize for ServeState
impl StructuralPartialEq for ServeState
Auto Trait Implementations§
impl Freeze for ServeState
impl RefUnwindSafe for ServeState
impl Send for ServeState
impl Sync for ServeState
impl Unpin for ServeState
impl UnsafeUnpin for ServeState
impl UnwindSafe for ServeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.