use super::*;
use crate::asyncio::*;
use runng_sys::*;
#[derive(Clone, Debug, NngGetOpts, NngSetOpts)]
#[prefix = "nng_socket_"]
pub struct Push0 {
socket: NngSocket,
}
impl Push0 {
pub fn open() -> Result<Self> {
nng_open(
|socket| unsafe { nng_push0_open(socket) },
|socket| Push0 { socket },
)
}
}
impl GetSocket for Push0 {
fn socket(&self) -> &NngSocket {
&self.socket
}
fn socket_mut(&mut self) -> &mut NngSocket {
&mut self.socket
}
}
impl Socket for Push0 {}
impl Dial for Push0 {}
impl Listen for Push0 {}
impl SendSocket for Push0 {}
impl AsyncSocket for Push0 {
type ContextType = PushAsyncHandle;
}