diff options
Diffstat (limited to '')
-rw-r--r-- | src/platform/uapi.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/platform/uapi.rs b/src/platform/uapi.rs new file mode 100644 index 0000000..6922a9c --- /dev/null +++ b/src/platform/uapi.rs @@ -0,0 +1,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>; +} |