[go: up one dir, main page]

reis/
lib.rs

1#![forbid(unsafe_code)]
2
3// TODO split up
4
5use std::{env, path::PathBuf};
6
7pub use wire::PendingRequestResult; // XXX types? names?
8pub mod ei;
9mod eiproto_ei;
10mod eiproto_eis;
11mod eiproto_enum;
12pub mod eis;
13mod error;
14pub use error::Error;
15pub mod event; // XXX reorganize?
16pub mod handshake; // XXX ^
17mod object;
18pub mod request;
19pub use object::Object;
20mod util;
21mod wire;
22// TODO make (a version of) this public and documented?
23#[doc(hidden)]
24pub use wire::Interface;
25pub use wire::ParseError;
26
27#[cfg(feature = "calloop")]
28//#[doc(hidden)] // TODO
29pub mod calloop;
30#[cfg(feature = "tokio")]
31pub mod tokio;
32
33// TODO versioning?
34
35mod private {
36    pub trait Sealed {}
37}
38
39// XXX
40// Want to fallback to higher number if exists, on server?
41// create on server, not client.
42pub fn default_socket_path() -> Option<PathBuf> {
43    let mut path = PathBuf::from(env::var_os("XDG_RUNTIME_DIR")?);
44    path.push("eis-0");
45    Some(path)
46}