#![doc = include_str!("../README.md")]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
mod service;
use std::io;
use std::num::ParseIntError;
pub use service::Binding;
pub use service::Listener;
pub use service::Stream;
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
BadAddress(io::Error),
BadDescriptor(ParseIntError),
DescriptorOutOfRange(i32),
DescriptorsMissing,
UnsupportedScheme,
}
impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::BadDescriptor(error)
}
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}
impl std::error::Error for Error {}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_display() {
format!("{}", Error::UnsupportedScheme);
}
}