ListenerOptions

Struct ListenerOptions 

Source
pub struct ListenerOptions<'n> { /* private fields */ }
Available on crate features pubsub and ipc only.
Expand description

A builder for local socket listeners, including Listener.

Implementations§

Source§

impl ListenerOptions<'_>

Creation.

Source

pub fn new() -> ListenerOptions<'_>

Creates an options table with default values.

Source§

impl<'n> ListenerOptions<'n>

Option setters.

Source

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

Sets the name the server will listen on.

Source

pub fn nonblocking( self, nonblocking: ListenerNonblockingMode, ) -> ListenerOptions<'n>

Selects the nonblocking mode to be used by the listener.

The default value is Neither.

Source

pub fn reclaim_name(self, reclaim_name: bool) -> ListenerOptions<'n>

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

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>(self) -> Result<L, Error>
where L: Listener,

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

Source

pub fn create_tokio(self) -> Result<Listener, Error>

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>(self) -> Result<L, Error>
where L: Listener,

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

Trait Implementations§

Source§

impl Connect for ListenerOptions<'_>

Source§

type Listener = Listener

The listener type produced by the connect object.
Source§

type Error = Error

The error type for instantiating a Listener.
Source§

async fn make_listener(self) -> Result<Self::Listener, Self::Error>

Create the listener
Source§

fn notification_buffer_size(&self) -> usize

Configure the notification buffer size for each task spawned by the listener. Read more
Source§

fn serve_with_handle( self, router: Router<()>, handle: Handle, ) -> impl Future<Output = Result<ServerShutdown, Self::Error>> + Send

Instantiate and run a task to accept connections, returning a shutdown signal. Read more
Source§

fn serve( self, router: Router<()>, ) -> impl Future<Output = Result<ServerShutdown, Self::Error>> + Send

Instantiate and run a task to accept connections, returning a shutdown signal. Read more
Source§

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

Source§

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

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

impl Default for ListenerOptions<'_>

Source§

fn default() -> ListenerOptions<'_>

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

impl ListenerOptionsExt for ListenerOptions<'_>

Source§

fn mode(self, mode: u32) -> ListenerOptions<'_>

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<ListenerOptions<'_>, Error>

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> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,