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: StatusImplementations§
Source§impl 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 Freeze for NuConfig
impl RefUnwindSafe for NuConfig
impl Send for NuConfig
impl Sync for NuConfig
impl Unpin for NuConfig
impl UnwindSafe for NuConfig
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more