aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform/udp.rs
blob: f21a3d31dd4445789280213656509055d336b6cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
/* Often times an a file descriptor in an atomic might suffice.
 */
pub trait Bind<Endpoint>: Send + Sync {
    type Error;

    fn new() -> Self;
    fn set_port(&self, port: u16) -> Result<(), Self::Error>;
    fn get_port(&self) -> u16;
    fn recv(&self, dst: &mut [u8]) -> Endpoint;
    fn send(&self, src: &[u8], dst: &Endpoint);
}