Skip to main content

ConfigPaths

Struct ConfigPaths 

Source
pub struct ConfigPaths;
Expand description

Configuration path utilities.

Uses reovim-arch::dirs for platform-agnostic path resolution. Follows XDG Base Directory Specification on Unix.

§Environment Variable Overrides

All paths can be overridden via environment variables for worktree isolation and testing:

VariableOverridesPurpose
REOVIM_CONFIG_DIRconfig_dir()User config (modules.toml, profiles)
REOVIM_DATA_DIRdata_dir()Runtime data (.so modules, lock files, logs)
REOVIM_CACHE_DIRcache_dir()Cache (derived from data if unset)

Resolution order: $REOVIM_*_DIR > XDG/platform default.

Implementations§

Source§

impl ConfigPaths

Source

pub fn config_dir() -> Result<PathBuf, ConfigError>

Get the reovim config directory.

Resolution: $REOVIM_CONFIG_DIR > $XDG_CONFIG_HOME/reovim > ~/.config/reovim

§Errors

Returns ConfigError::PathError if the config directory cannot be determined and no env override is set.

Source

pub fn data_dir() -> Result<PathBuf, ConfigError>

Get the reovim data directory.

Resolution: $REOVIM_DATA_DIR > $XDG_DATA_HOME/reovim > ~/.local/share/reovim

§Errors

Returns ConfigError::PathError if the data directory cannot be determined and no env override is set.

Source

pub fn cache_dir() -> Result<PathBuf, ConfigError>

Get the reovim cache directory.

Resolution: $REOVIM_CACHE_DIR > $XDG_CACHE_HOME/reovim > ~/.cache/reovim

§Errors

Returns ConfigError::PathError if the cache directory cannot be determined and no env override is set.

Source

pub fn config_file() -> Result<PathBuf, ConfigError>

Get the path to the main config file.

Returns {config_dir}/config.toml

§Errors

Returns ConfigError::PathError if the config directory cannot be determined.

Source

pub fn profiles_dir() -> Result<PathBuf, ConfigError>

Get the profiles directory.

Returns {config_dir}/profiles/

§Errors

Returns ConfigError::PathError if the config directory cannot be determined.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.