pub async fn send_to<A: AsRef<Path>>(&self, buf: &[u8], addr: A) -> Result<usize> {
        let addr = nix::sys::socket::SockAddr::new_unix(addr.as_ref())
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
        self.socket.send_to(buf, addr).await.map_err(Into::into)
    }
/// Sends data on the socket to the given address. On success, returns the
/// number of bytes written.
///
/// # Examples
///
/// ```no_run
/// use glommio::{net::UnixDatagram, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     let sender = UnixDatagram::unbound().unwrap();
///     sender.send_to(&[1; 1], "/tmp/dgram").await.unwrap();
/// })
/// ```
Sends data on the socket to the given address. On success, returns the
number of bytes written.
Sends data on the socket to the given address . On success returns the number of bytes written .
pub async fn send_to<A: AsRef<Path>>(&self, buf: &[u8], addr: A) -> Result<usize> {
        let addr = nix::sys::socket::SockAddr::new_unix(addr.as_ref())
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
        self.socket.send_to(buf, addr).await.map_err(Into::into)
    }
pub async fn send_to < A : AsRef < Path > > ( & self , buf : & [ u8 ] , addr : A ) -> Result < usize > { let addr = nix :: sys :: socket :: SockAddr :: new_unix ( addr . as_ref ( ) ) . map_err ( | e | io :: Error :: new ( io :: ErrorKind :: Other , e ) ) ? ; self . socket . send_to ( buf , addr ) . await . map_err ( Into :: into ) }
Sends data on the socket to the given address.
Sends data on the socket to the given address .
&self
buf
&[u8]
addr
A
&self
buf
&[u8]
addr
A
examples
```no_run
use glommio::{net::UnixDatagram, LocalExecutor}.

let ex = LocalExecutor::default();
ex.run(async move {
let sender = UnixDatagram::unbound().unwrap();
sender.send_to(&[1; 1], "/tmp/dgram").await.unwrap();
})
```
` ` ` no_run use glommio :: { net :: UnixDatagram LocalExecutor } . let ex = LocalExecutor :: default () ; ex . run ( async move { let sender = UnixDatagram :: unbound () . unwrap () ; sender . send_to ( & [ 1 ; 1 ] " / tmp / dgram " ) . await . unwrap () ; } ) ` ` `