Struct ListenerOptions

Source
pub struct ListenerOptions<'n> { /* private fields */ }
Expand description

A builder for local socket listeners, including Listener.

Implementations§

Source§

impl ListenerOptions<'_>

Creation.

Source

pub fn new() -> Self

Creates an options table with default values.

Source§

impl<'n> ListenerOptions<'n>

Option setters.

Source

pub fn name(self, name: Name<'n>) -> Self

Sets the name the server will listen on.

Source

pub fn nonblocking(self, nonblocking: ListenerNonblockingMode) -> Self

Selects the nonblocking mode to be used by the listener.

The default value is Neither.

Source

pub fn reclaim_name(self, reclaim_name: bool) -> Self

Sets whether name reclamation is to happen or not.

This is enabled by default.

Source§

impl ListenerOptions<'_>

Listener constructors.

Source

pub fn create_sync(self) -> Result<Listener>

Creates a Listener, binding it to the specified local socket name.

On platforms where there are multiple available implementations, this dispatches to the appropriate implementation based on where the name points to.

Source

pub fn create_sync_as<L: Listener>(self) -> Result<L>

Creates the given type of listener, binding it to the specified local socket name.

Source

pub fn create_tokio(self) -> Result<TokioListener>

Creates a Listener, binding it to the specified local socket name.

On platforms where there are multiple available implementations, this dispatches to the appropriate implementation based on where the name points to.

Source

pub fn create_tokio_as<L: Listener>(self) -> Result<L>

Creates the given type of listener, binding it to the specified local socket name.

Trait Implementations§

Source§

impl<'n> Debug for ListenerOptions<'n>

Source§

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

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

impl Default for ListenerOptions<'_>

Source§

fn default() -> Self

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

impl ListenerOptionsExt for ListenerOptions<'_>

Available on Unix only.
Source§

fn mode(self, mode: mode_t) -> Self

Sets the file mode (Unix permissions) to be applied to the socket file. Read more
Source§

impl TryClone for ListenerOptions<'_>

Source§

fn try_clone(&self) -> Result<Self>

Clones self, possibly returning an error.

Auto Trait Implementations§

§

impl<'n> Freeze for ListenerOptions<'n>

§

impl<'n> RefUnwindSafe for ListenerOptions<'n>

§

impl<'n> Send for ListenerOptions<'n>

§

impl<'n> Sync for ListenerOptions<'n>

§

impl<'n> Unpin for ListenerOptions<'n>

§

impl<'n> UnwindSafe for ListenerOptions<'n>

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> 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, 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.