pub struct RuntimoConfig {
pub allowed_paths: Vec<String>,
}Expand description
Runtimo persistent configuration.
Fields§
§allowed_paths: Vec<String>Additional allowed path prefixes (merged with defaults + env var).
Implementations§
Source§impl RuntimoConfig
impl RuntimoConfig
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Returns the config file path following XDG spec.
Uses XDG_CONFIG_HOME if set, otherwise ~/.config/runtimo/config.toml.
Sourcepub fn load() -> Self
pub fn load() -> Self
Loads config from disk, returning defaults if the file doesn’t exist or is invalid.
Sourcepub fn save(&self) -> Result<(), String>
pub fn save(&self) -> Result<(), String>
Saves config to disk, creating parent directories as needed.
Sourcepub fn get_allowed_prefixes() -> Vec<String>
pub fn get_allowed_prefixes() -> Vec<String>
Returns merged prefixes: defaults + env var + config file.
Priority (lowest to highest):
- Built-in defaults
RUNTIMO_ALLOWED_PATHSenv var- Config file
allowed_paths
Trait Implementations§
Source§impl Clone for RuntimoConfig
impl Clone for RuntimoConfig
Source§fn clone(&self) -> RuntimoConfig
fn clone(&self) -> RuntimoConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimoConfig
impl Debug for RuntimoConfig
Source§impl Default for RuntimoConfig
impl Default for RuntimoConfig
Source§fn default() -> RuntimoConfig
fn default() -> RuntimoConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RuntimoConfig
impl<'de> Deserialize<'de> for RuntimoConfig
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 RuntimoConfig
impl RefUnwindSafe for RuntimoConfig
impl Send for RuntimoConfig
impl Sync for RuntimoConfig
impl Unpin for RuntimoConfig
impl UnsafeUnpin for RuntimoConfig
impl UnwindSafe for RuntimoConfig
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