pub struct NuConfig {
pub vars: IndexMap<String, Value>,
pub file_path: PathBuf,
pub modified_at: Status,
}
Fields
vars: IndexMap<String, Value>
file_path: PathBuf
modified_at: Status
Implementations
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>>
pub fn var(&self, key: &str) -> Option<Value>
pub fn env(&self) -> Option<Value>
pub fn path(&self) -> Result<Option<Vec<PathBuf>>, ShellError>
pub fn exit_scripts(&self) -> Result<Vec<String>, ShellError>
pub fn startup_scripts(&self) -> Result<Vec<String>, ShellError>
Trait Implementations
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
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