ts3_clientquery_lib/
lib.rs

1#[cfg(feature = "client")]
2pub mod client;
3pub mod connection;
4pub mod error;
5#[cfg(feature = "server")]
6pub mod server;
7pub mod types;
8
9mod from_query_string {
10    pub trait FromQueryString: for<'de> serde::de::Deserialize<'de> {
11        fn from_query(data: &str) -> Result<Self, serde_teamspeak_querystring::Error>
12        where
13            Self: Sized,
14        {
15            serde_teamspeak_querystring::from_str(data)
16        }
17    }
18
19    impl FromQueryString for () {
20        fn from_query(_data: &str) -> Result<Self, serde_teamspeak_querystring::Error>
21        where
22            Self: Sized,
23        {
24            Ok(())
25        }
26    }
27
28    impl FromQueryString for String {
29        fn from_query(data: &str) -> Result<Self, serde_teamspeak_querystring::Error>
30        where
31            Self: Sized,
32        {
33            Ok(data.to_string())
34        }
35    }
36}
37
38pub use serde_teamspeak_querystring::escape;
39
40pub use from_query_string::FromQueryString;