pub struct Paths {
pub config_dir: PathBuf,
pub data_dir: PathBuf,
}Expand description
Resolved on-disk directories for this tool.
Fields§
§config_dir: PathBufDirectory holding config.toml and (by default) credentials.json.
data_dir: PathBufDirectory holding the cached OAuth token.json.
Implementations§
Source§impl Paths
impl Paths
Sourcepub fn resolve(env: &EnvInputs) -> Result<Self>
pub fn resolve(env: &EnvInputs) -> Result<Self>
Resolve the config and data directories from captured environment inputs.
Precedence: an explicit ORG_GDOCS_*_HOME override wins; otherwise the
XDG base (XDG_CONFIG_HOME / XDG_DATA_HOME, else ~/.config /
~/.local/share) joined with the [APP_DIR] subdirectory.
§Errors
Returns Error::PathResolution when neither an override nor the XDG
base nor HOME is available to anchor a directory.
Sourcepub fn config_file(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
Path to this tool’s TOML configuration file.
Sourcepub fn default_credentials(&self) -> PathBuf
pub fn default_credentials(&self) -> PathBuf
Default path to the Google OAuth client secret (credentials.json).
Sourcepub fn default_token(&self) -> PathBuf
pub fn default_token(&self) -> PathBuf
Default path to the cached OAuth token (token.json).
Trait Implementations§
impl Eq for Paths
impl StructuralPartialEq for Paths
Auto Trait Implementations§
impl Freeze for Paths
impl RefUnwindSafe for Paths
impl Send for Paths
impl Sync for Paths
impl Unpin for Paths
impl UnsafeUnpin for Paths
impl UnwindSafe for Paths
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.