summaryrefslogtreecommitdiffstats
path: root/src/platform/uapi.rs
blob: 6922a9cc85d9c8a78737a3df57082fc77cd6bc07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::error::Error;
use std::io::{Read, Write};

pub trait BindUAPI {
    type Stream: Read + Write;
    type Error: Error;

    fn accept(&self) -> Result<Self::Stream, Self::Error>;
}

pub trait PlatformUAPI {
    type Error: Error;
    type Bind: BindUAPI;

    fn bind(name: &str) -> Result<Self::Bind, Self::Error>;
}