sesh_proto/
lib.rs

1use std::fmt::Display;
2
3tonic::include_proto!("sesh");
4
5impl Display for sesh_attach_request::Session {
6    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7        match self {
8            sesh_attach_request::Session::Id(id) => write!(f, "{}", id),
9            sesh_attach_request::Session::Name(name) => write!(f, "{}", name),
10        }
11    }
12}
13
14impl Display for sesh_detach_request::Session {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        match self {
17            sesh_detach_request::Session::Id(id) => write!(f, "{}", id),
18            sesh_detach_request::Session::Name(name) => write!(f, "{}", name),
19        }
20    }
21}
22
23impl Display for sesh_kill_request::Session {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        match self {
26            sesh_kill_request::Session::Id(id) => write!(f, "{}", id),
27            sesh_kill_request::Session::Name(name) => write!(f, "{}", name),
28        }
29    }
30}