Struct nu_command::config::NuConfig
source · [−]pub struct NuConfig {
pub vars: IndexMap<String, Value, RandomState>,
pub file_path: PathBuf,
pub modified_at: Status,
}Fields
vars: IndexMap<String, Value, RandomState>file_path: PathBufmodified_at: StatusImplementations
sourceimpl NuConfig
impl NuConfig
pub fn load(cfg_file_path: Option<PathBuf>) -> Result<NuConfig, ShellError>
sourcepub fn write(&self) -> Result<(), ShellError>
pub fn write(&self) -> Result<(), ShellError>
Writes self.values under self.file_path
pub fn new() -> NuConfig
pub fn get_last_modified(config_file: &Option<PathBuf>) -> Status
pub fn is_modified(&self) -> Result<bool, Box<dyn Error + 'static, Global>>
pub fn var(&self, key: &str) -> Option<Value>
sourcepub fn env_map(&self) -> IndexMap<String, String, RandomState>
pub fn env_map(&self) -> IndexMap<String, String, RandomState>
Return environment variables as map
pub fn env(&self) -> Option<Value>
pub fn path(&self) -> Result<Option<Vec<PathBuf, Global>>, ShellError>
pub fn exit_scripts(&self) -> Result<Vec<String, Global>, ShellError>
pub fn startup_scripts(&self) -> Result<Vec<String, Global>, ShellError>
Trait Implementations
sourceimpl Conf for NuConfig
impl Conf for NuConfig
pub fn is_modified(&self) -> Result<bool, Box<dyn Error + 'static, Global>>
pub fn var(&self, key: &str) -> Option<Value>
pub fn env(&self) -> Option<Value>
pub fn path(&self) -> Result<Option<Vec<PathBuf, Global>>, ShellError>
pub fn reload(&mut self)
pub fn clone_box(&self) -> Box<dyn Conf + 'static, Global>
Auto Trait Implementations
impl RefUnwindSafe for NuConfig
impl Send for NuConfig
impl Sync for NuConfig
impl Unpin for NuConfig
impl UnwindSafe for NuConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> SpannedItem for T
impl<T> SpannedItem for T
sourceimpl<T> TaggedItem for T
impl<T> TaggedItem for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more