pub struct Config {
pub vault_path: PathBuf,
pub rpc: HashMap<String, String>,
pub plugins: HashMap<String, Value>,
pub backup: Option<BackupConfig>,
}Expand description
Application configuration.
Fields§
§vault_path: PathBuf§rpc: HashMap<String, String>§plugins: HashMap<String, Value>§backup: Option<BackupConfig>Implementations§
Source§impl Config
impl Config
Sourcepub fn default_rpc() -> HashMap<String, String>
pub fn default_rpc() -> HashMap<String, String>
Returns the built-in default RPC endpoints for well-known chains.
Source§impl Config
impl Config
Sourcepub fn load(path: &Path) -> Result<Self, OwsError>
pub fn load(path: &Path) -> Result<Self, OwsError>
Load config from a file path, or return defaults if file doesn’t exist.
Sourcepub fn load_or_default() -> Self
pub fn load_or_default() -> Self
Load ~/.ows/config.json, merging user overrides on top of defaults.
If the file doesn’t exist, returns the built-in defaults.
Sourcepub fn load_or_default_from(path: &Path) -> Self
pub fn load_or_default_from(path: &Path) -> Self
Load config from a specific path, merging user overrides on top of defaults.
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