1#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
2
3pub use crate::client::Client;
4pub use crate::environment::configuration_from_environment;
5use authentication::TokenExpiration;
6pub use error::Error;
7
8pub mod api;
10mod authentication;
11mod base64;
12mod client;
13mod environment;
14mod error;
15mod fs;
16
17pub type Result<T> = std::result::Result<T, Error>;
18
19pub trait Configuration {
20 fn user_name(&self) -> &str;
21 fn private_key_pem_file(&self) -> &str;
22 fn token_path(&self) -> &str;
23 fn whitelisted_only(&self) -> bool;
24 fn read_only(&self) -> bool;
25 fn ipv6_only(&self) -> bool;
26 fn token_expiration(&self) -> TokenExpiration;
27}
28
29pub trait HasName {
30 fn name(&self) -> &str;
31}
32
33pub trait HasNames {
34 fn names(&self) -> Vec<&str>;
35}
36
37impl<T: HasName> HasNames for Vec<T> {
38 fn names(&self) -> Vec<&str> {
39 self.iter().map(|t| t.name()).collect::<Vec<_>>()
40 }
41}