[][src]Struct nng::Listener

pub struct Listener { /* fields omitted */ }

A constructed and running listener.

This listener has already been started on the socket and will continue serving the connection until either it is explicitly close or the owning socket is closed.

Methods

impl Listener[src]

pub fn new(socket: &Socket, url: &str, nonblocking: bool) -> Result<Self>[src]

Creates a new listener object associated with the given socket.

Note that this will immediately start the listener so no configuration will be possible. Use ListenerOptions to change the listener options before starting it.

pub fn close(self)[src]

Closes the listener.

This also closes any Pipe objects that have been created by the listener. Once this function returns, the listener has been closed and all of its resources have been deallocated. Therefore, any attempt to utilize the listener (with this or any other handle) will result in an error.

Listeners are implicitly closed when the socket they are associated with is closed. Listeners are not closed when all handles are dropped.

Trait Implementations

impl GetOpt<LocalAddr> for Listener[src]

impl GetOpt<Raw> for Listener[src]

impl GetOpt<RecvBufferSize> for Listener[src]

impl GetOpt<RecvTimeout> for Listener[src]

impl GetOpt<SendBufferSize> for Listener[src]

impl GetOpt<Url> for Listener[src]

impl GetOpt<SendTimeout> for Listener[src]

impl GetOpt<SocketName> for Listener[src]

impl GetOpt<MaxTtl> for Listener[src]

impl GetOpt<ResendTime> for Listener[src]

impl GetOpt<SurveyTime> for Listener[src]

impl GetOpt<NoDelay> for Listener[src]

impl GetOpt<KeepAlive> for Listener[src]

impl Eq for Listener[src]

impl Copy for Listener[src]

impl PartialOrd<Listener> for Listener[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<Listener> for Listener[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for Listener[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for Listener[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Debug for Listener[src]

impl Hash for Listener[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Listener

impl Sync for Listener

Blanket Implementations

impl<T> Options for T where
    T: HasOpts, 
[src]

fn get_opt<T: OptOps>(&self) -> Result<T::OptType> where
    Self: GetOpt<T>, 
[src]

Reads the specified option from the object.

fn set_opt<T: OptOps>(&self, val: T::OptType) -> Result<()> where
    Self: SetOpt<T>, 
[src]

Writes the specified option to the object.

unsafe fn unsafe_get_opt<T: OptOps>(&self) -> Result<T::OptType> where
    Self: UnsafeGetOpt<T>, 
[src]

Reads the specified option from the object. Read more

unsafe fn unsafe_set_opt<T: OptOps>(&self, val: T::OptType) -> Result<()> where
    Self: UnsafeGetOpt<T>, 
[src]

Writes the specified option to the object. Read more

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.