namaste 0.19.0

Simple locks between processes
Documentation
// License: see LICENSE file at root directory of main branch

//! # Namaste on Linux

#![cfg(any(target_os = "linux", target_os = "l4re", target_os = "android"))]

use {
    std::os::unix::net::{SocketAddr, UnixListener},
    crate::Result,
};

/// # Namaste on Linux
#[derive(Debug)]
pub struct Namaste {

    _unix_listener: UnixListener,

}

impl Namaste {

    /// # Makes new instance using abstract Linux socket
    pub (crate) fn make<B>(id: B) -> Result<Self> where B: AsRef<[u8]> {
        Ok(Self {
            _unix_listener: UnixListener::bind_addr(&SocketAddr::from_abstract_namespace(id.as_ref())?)?,
        })
    }

}