pub struct ConfigFile {
pub version: u32,
pub name: String,
pub client_id: String,
pub client_secret: String,
pub scopes: Vec<String>,
pub redirect_url: String,
pub refresh_token: Option<String>,
pub id_token: Option<Token>,
pub access_token: Option<Token>,
}
Expand description
A configuration file that saves the information necessary to fetch tokens and to be able to refresh said tokens when needed.
Fields§
§version: u32
§name: String
§client_id: String
§client_secret: String
§scopes: Vec<String>
§redirect_url: String
§refresh_token: Option<String>
§id_token: Option<Token>
§access_token: Option<Token>
Implementations§
Source§impl ConfigFile
impl ConfigFile
Source§impl ConfigFile
impl ConfigFile
pub fn config_file( name: &str, config_base_path: &ConfigBasePath, ) -> Result<PathBuf, LibError>
pub fn list_configs( config_base_path: &ConfigBasePath, ) -> Result<Vec<ConfigFile>, LibError>
pub fn read_config( name: &str, config_base_path: &ConfigBasePath, ) -> Result<ConfigFile, LibError>
pub fn save_config( &self, config_base_path: &ConfigBasePath, ) -> Result<(), LibError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ConfigFile
impl<'de> Deserialize<'de> for ConfigFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnwindSafe for ConfigFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more