tlns_google_oauth2_traits/lib.rs
1#![doc = include_str!("../README.md")]
2
3/// Converting enum scopes to string
4pub trait ToGoogleScope {
5 /// Converting the enum back to [`str`] literal
6 fn to_google_scope(&self) -> &'static str;
7}
8
9/// Converting scope strings to `T`
10pub trait FromGoogleScope<T> {
11 /// Converting Google Scope string to enum
12 /// This might return [`Err`] if you input an invalid Google Scope.
13 fn from_google_scope(google_scope: &str) -> Result<T, ()>;
14}