You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/eis.rs
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,13 +29,23 @@ pub struct Listener {
29
29
implListener{
30
30
// TODO Use a lock here
31
31
/// Listens on a specific path.
32
+
///
33
+
/// # Errors
34
+
///
35
+
/// Will return `Err` if binding to the given path or setting the socket to
36
+
/// non-blocking mode fails.
32
37
pubfnbind(path:&Path) -> io::Result<Self>{
33
38
Self::bind_inner(PathBuf::from(path),None)
34
39
}
35
40
36
41
// XXX result type?
37
42
// Error if XDG_RUNTIME_DIR not set?
38
43
/// Listens on a file in `XDG_RUNTIME_DIR`.
44
+
///
45
+
/// # Errors
46
+
///
47
+
/// Will return `Err` if a lock file cannot be locked, binding to the generated path
48
+
/// fails or setting the socket to non-blocking mode fails.
39
49
pubfnbind_auto() -> io::Result<Option<Self>>{
40
50
let xdg_dir = ifletSome(var) = env::var_os("XDG_RUNTIME_DIR"){
41
51
PathBuf::from(var)
@@ -65,6 +75,10 @@ impl Listener {
65
75
}
66
76
67
77
/// Accepts a connection from a client. Returns `Ok(Some(_)` if an incoming connection is ready, and `Ok(None)` if there is no connection ready (would block).
0 commit comments