pub struct UserConfig { /* private fields */ }Expand description
User-level codex-ws configuration.
Implementations§
Source§impl UserConfig
impl UserConfig
Sourcepub fn cc_switch_db(&self) -> Option<&Path>
pub fn cc_switch_db(&self) -> Option<&Path>
Return the configured cc-switch database path.
§Returns
The configured path, if the user set cc-switch-db.
Sourcepub fn set_value(
&mut self,
name: &str,
value: PathBuf,
) -> Result<(), ConfigError>
pub fn set_value( &mut self, name: &str, value: PathBuf, ) -> Result<(), ConfigError>
Set a supported configuration value.
§Arguments
name- Supported configuration key.value- Value to store for the key.
§Errors
Returns ConfigError::UnsupportedConfigName when name is not supported.
Sourcepub fn get_value(&self, name: &str) -> Result<Option<ConfigEntry>, ConfigError>
pub fn get_value(&self, name: &str) -> Result<Option<ConfigEntry>, ConfigError>
Return one supported configuration value.
§Arguments
name- Supported configuration key.
§Returns
The configuration entry when the key is set.
§Errors
Returns ConfigError::UnsupportedConfigName when name is not supported.
Sourcepub fn entries(&self) -> Vec<ConfigEntry>
pub fn entries(&self) -> Vec<ConfigEntry>
Trait Implementations§
Source§impl Clone for UserConfig
impl Clone for UserConfig
Source§fn clone(&self) -> UserConfig
fn clone(&self) -> UserConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserConfig
impl Debug for UserConfig
Source§impl Default for UserConfig
impl Default for UserConfig
Source§fn default() -> UserConfig
fn default() -> UserConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UserConfig
impl<'de> Deserialize<'de> for UserConfig
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
impl Eq for UserConfig
Source§impl PartialEq for UserConfig
impl PartialEq for UserConfig
Source§fn eq(&self, other: &UserConfig) -> bool
fn eq(&self, other: &UserConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UserConfig
impl Serialize for UserConfig
impl StructuralPartialEq for UserConfig
Auto Trait Implementations§
impl Freeze for UserConfig
impl RefUnwindSafe for UserConfig
impl Send for UserConfig
impl Sync for UserConfig
impl Unpin for UserConfig
impl UnsafeUnpin for UserConfig
impl UnwindSafe for UserConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.