pub struct Config {
pub root: Option<PathBuf>,
pub proxy: Option<String>,
pub node_mirror: Option<String>,
pub npm_mirror: Option<String>,
pub arch: Option<ArchSpec>,
pub originalpath: Option<PathBuf>,
pub originalversion: Option<String>,
/* private fields */
}Fields§
§root: Option<PathBuf>Node.js storage root
proxy: Option<String>Node.js proxy
node_mirror: Option<String>Node.js mirror
npm_mirror: Option<String>npm mirror
arch: Option<ArchSpec>§originalpath: Option<PathBuf>§originalversion: Option<String>Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Config
pub fn load() -> Config
Load config from file. Returns None if no config file exists.
If both toml and yaml features are enabled, it will try to load from toml first.
If toml is not enabled, it will try to load from yaml.
If yaml is not enabled, it will return None.
pub fn save(&self) -> Result
pub fn is_valid(&self) -> Result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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