Skip to main content

HostOptions

Struct HostOptions 

Source
pub struct HostOptions { /* private fields */ }
Expand description

Host-side transport options, passed to host_with_options. HostOptions::default() is what host uses.

Implementations§

Source§

impl HostOptions

Source

pub fn new() -> Self

Source

pub fn max_pipe_instances(self, n: u32) -> Self

Cap on simultaneous instances of the Windows named pipe: live connections plus the one instance waiting for the next client. A client that arrives when the cap is reached gets “pipe busy” and retries, so a flood of connections cannot grow the host without bound. Default DEFAULT_MAX_PIPE_INSTANCES (16); clamped to 1..=254 (255 is “unlimited” to Win32 and is never used). Ignored on Unix, where there is no pipe.

Source

pub fn get_max_pipe_instances(&self) -> u32

The effective (clamped) cap.

Source

pub fn write_timeout(self, bound: Option<Duration>) -> Self

Longest one frame (hello, event, or response) may take to write and flush to a client. A client that stops reading fills the transport buffer and would otherwise block the writing thread, and the connection with it, forever; when the bound passes the host closes that connection (the client sees connection_closed, never a partial frame it could mistake for a reply), and the connection’s connection_closed handler hook runs. The bound is per frame, so a slow but progressing reader of a stream of events is not cut off unless a single frame stalls. Default DEFAULT_WRITE_TIMEOUT (120 s); None restores the earlier unbounded write. A zero duration is raised to 1 ms.

Source

pub fn get_write_timeout(&self) -> Option<Duration>

The effective write bound (None = unbounded).

Trait Implementations§

Source§

impl Clone for HostOptions

Source§

fn clone(&self) -> Self

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 Copy for HostOptions

Source§

impl Debug for HostOptions

Source§

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

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

impl Default for HostOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for HostOptions

Source§

impl PartialEq for HostOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HostOptions

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.