Enum dprint_core::configuration::ConfigKeyValue
source · pub enum ConfigKeyValue {
String(String),
Number(i32),
Bool(bool),
Array(Vec<ConfigKeyValue>),
Object(ConfigKeyMap),
Null,
}
Variants§
Implementations§
source§impl ConfigKeyValue
impl ConfigKeyValue
pub fn as_string(&self) -> Option<&String>
pub fn as_number(&self) -> Option<i32>
pub fn as_bool(&self) -> Option<bool>
pub fn as_array(&self) -> Option<&Vec<ConfigKeyValue>>
pub fn as_object(&self) -> Option<&ConfigKeyMap>
pub fn into_string(self) -> Option<String>
pub fn into_number(self) -> Option<i32>
pub fn into_bool(self) -> Option<bool>
pub fn into_array(self) -> Option<Vec<ConfigKeyValue>>
pub fn into_object(self) -> Option<ConfigKeyMap>
pub fn is_null(&self) -> bool
sourcepub fn hash(&self, hasher: &mut impl Hasher)
pub fn hash(&self, hasher: &mut impl Hasher)
Gets a hash of the configuration value. This is used for incremental formatting and the Hash trait is not implemented to discourage using this in other places.
pub fn from_i32(value: i32) -> ConfigKeyValue
pub fn from_str(value: &str) -> ConfigKeyValue
pub fn from_bool(value: bool) -> ConfigKeyValue
Trait Implementations§
source§impl Clone for ConfigKeyValue
impl Clone for ConfigKeyValue
source§fn clone(&self) -> ConfigKeyValue
fn clone(&self) -> ConfigKeyValue
Returns a copy of the value. Read more
1.0.0 · 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 ConfigKeyValue
impl Debug for ConfigKeyValue
source§impl<'de> Deserialize<'de> for ConfigKeyValue
impl<'de> Deserialize<'de> for ConfigKeyValue
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
source§impl From<&str> for ConfigKeyValue
impl From<&str> for ConfigKeyValue
source§impl From<String> for ConfigKeyValue
impl From<String> for ConfigKeyValue
source§impl From<bool> for ConfigKeyValue
impl From<bool> for ConfigKeyValue
source§impl From<i32> for ConfigKeyValue
impl From<i32> for ConfigKeyValue
source§impl PartialEq for ConfigKeyValue
impl PartialEq for ConfigKeyValue
source§fn eq(&self, other: &ConfigKeyValue) -> bool
fn eq(&self, other: &ConfigKeyValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ConfigKeyValue
impl Serialize for ConfigKeyValue
impl Eq for ConfigKeyValue
impl StructuralPartialEq for ConfigKeyValue
Auto Trait Implementations§
impl Freeze for ConfigKeyValue
impl RefUnwindSafe for ConfigKeyValue
impl Send for ConfigKeyValue
impl Sync for ConfigKeyValue
impl Unpin for ConfigKeyValue
impl UnwindSafe for ConfigKeyValue
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<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.