[][src]Struct namaste::Namaste

pub struct Namaste { /* fields omitted */ }

Namaste

  • Required features: abstract-linux-sockets.
  • Supported on Linux only.

Usage

You can call make() and pass your ID to that function. When done, simply drop it via drop().

Notes

  • This struct uses Linux's abstract sockets underneath (see man 7 unix for details).
  • After successfully made, it keeps a socket file descriptor inside. When the struct is being dropped, it tries to close that file descriptor, and prints out errors to stderr, if any.
  • Currently, std::os::unix::net does not (yet) support abstract sockets. If support would be added, this implementation would likely to be switched to using that, instead of libc.

Methods

impl Namaste[src]

pub unsafe fn make(id: Id) -> Result<Self>[src]

Makes new instance

An error is returned if calling to functions in libc fails. Currently, error kind is simply Other. Error message will contain the original libc function name and possible errno.

Your ID will be filled into sockaddr_un.sun_path from #1 index. All other bytes are zeros. The whole array will be used as address.

Trait Implementations

impl PartialEq<Namaste> for Namaste[src]

impl Drop for Namaste[src]

impl Eq for Namaste[src]

impl Hash for Namaste[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

impl Debug for Namaste[src]

Auto Trait Implementations

impl Send for Namaste

impl Unpin for Namaste

impl Sync for Namaste

impl UnwindSafe for Namaste

impl RefUnwindSafe for Namaste

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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