Skip to main content

ListenerConfig

Struct ListenerConfig 

Source
pub struct ListenerConfig {
    pub addr: SocketAddr,
    pub idle_timeout: Duration,
    pub slow_threshold: Duration,
    pub auth_required: bool,
    pub tls: Option<ServerTls>,
}
Expand description

Listener configuration. Family posture keeps binds loopback/private by default (SRV-040 guidance).

Fields§

§addr: SocketAddr

Address to bind. Port 0 picks an ephemeral port — read it back via ListenerHandle::local_addr.

§idle_timeout: Duration

Per-read idle timeout (slow-loris resistance, SRV-009). Zero disables, matching each product’s current posture.

§slow_threshold: Duration

Commands slower than this bump slow_commands_total (SRV-030). Zero disables the counter.

§auth_required: bool

Whether this deployment enforces credentials (SRV-011).

This is policy, not protocol: the profile fixes the handshake shape (does the client lead with HELLO? does it authenticate via AUTH?), while this flag decides whether the server actually refuses un-credentialed sessions. Both family products that authenticate on the RPC path expose exactly this toggle — Nexus’s auth_required and Synap’s require_auth — and an open Synap deployment is the reason it must live here rather than in the profile.

Ignored under Handshake::None, which has no gate at all. Defaults to true: a deployment opens up only by saying so.

§tls: Option<ServerTls>

Optional TLS (SRV-040 / SPEC-008 CAN-020). Some turns TLS on for this deployment; None (the default) keeps it plaintext. Requires the crate’s tls feature — a listener configured with TLS but built without it fails to start rather than silently serving plaintext.

Implementations§

Source§

impl ListenerConfig

Source

pub fn new(addr: SocketAddr) -> Self

Config for addr with the defaults: no idle timeout, 1000 ms slow threshold, credentials enforced, plaintext.

Source

pub fn with_tls(self, tls: ServerTls) -> Self

Turn TLS on for this deployment (SRV-040): the listener wraps every accepted stream in tokio-rustls before the first Thunder frame.

Source

pub fn open(self) -> Self

Serve un-credentialed sessions — the auth_required = false / require_auth = false posture (e.g. an open Synap deployment).

The handshake shape is unchanged: a client may still send AUTH, and it still succeeds or fails on its own merits; nothing is required.

Trait Implementations§

Source§

impl Clone for ListenerConfig

Source§

fn clone(&self) -> ListenerConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ListenerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ListenerConfig

Source§

fn default() -> Self

Loopback on an ephemeral port with the standard defaults.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.