rs9p 0.13.0

Filesystems library using 9P2000.L protocol, an extended variant of 9P from Plan 9
Documentation
use crate::error;

pub type Result<T> = ::std::result::Result<T, error::Error>;

#[macro_export]
macro_rules! io_err {
    ($kind:ident, $msg:expr) => {
        ::std::io::Error::new(::std::io::ErrorKind::$kind, $msg)
    };
}

#[macro_export]
macro_rules! res {
    ($err:expr) => {
        Err(From::from($err))
    };
}

pub fn parse_proto(arg: &str) -> Option<(&str, &str, &str)> {
    let mut split = arg.split('!');
    let (proto, addr, port) = (split.next()?, split.next()?, split.next()?);

    Some((proto, addr, port))
}