pub struct ConfigEntry { /* private fields */ }Expand description
A class representing a configuration entry containing name, value and additional metadata.
§Translation notes
Debug renders what Display renders.
Implementations§
Source§impl ConfigEntry
impl ConfigEntry
Sourcepub fn new(name: String, value: Option<String>) -> Self
pub fn new(name: String, value: Option<String>) -> Self
Create a configuration entry with the provided values.
§Arguments
name- the non-None config namevalue- the config value orNone
Sourcepub fn with_options(options: ConfigEntryOptions) -> Self
pub fn with_options(options: ConfigEntryOptions) -> Self
Create a configuration with the provided values.
§Arguments
options- the parameters of Java’s widest constructor:name,value,source,is_sensitive,is_read_only,synonyms,config_typeanddocumentation
Sourcepub fn value(&self) -> Option<&str>
pub fn value(&self) -> Option<&str>
Returns the value or None. None is returned if the config is unset or
if is_sensitive is true.
Sourcepub fn source(&self) -> ConfigSource
pub fn source(&self) -> ConfigSource
Returns the source of this configuration entry.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns whether the config value is the default or if it’s been explicitly set.
Sourcepub fn is_sensitive(&self) -> bool
pub fn is_sensitive(&self) -> bool
Returns whether the config value is sensitive. The value is always set to
None by the broker if the config value is sensitive.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns whether the config is read-only and cannot be updated.
Sourcepub fn synonyms(&self) -> &[ConfigSynonym]
pub fn synonyms(&self) -> &[ConfigSynonym]
Returns all config values that may be used as the value of this config
along with their source, in the order of precedence. The list starts
with the value returned in this ConfigEntry. The list is empty if
synonyms were not requested.
Sourcepub fn type(&self) -> Option<ConfigType>
pub fn type(&self) -> Option<ConfigType>
Returns the config data type.
Sourcepub fn documentation(&self) -> Option<&str>
pub fn documentation(&self) -> Option<&str>
Returns the config documentation.
Trait Implementations§
Source§impl Clone for ConfigEntry
impl Clone for ConfigEntry
Source§fn clone(&self) -> ConfigEntry
fn clone(&self) -> ConfigEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigEntry
Renders exactly what the redacting Display renders.
impl Debug for ConfigEntry
Renders exactly what the redacting Display renders.
Java has a single toString(), which prints
Redacted for the value of a sensitive entry; a derived Debug would be a
second, unredacted rendering. Config and
AlterConfigOp embed entries, so their
derived Debug renders through this one.
Source§impl Display for ConfigEntry
impl Display for ConfigEntry
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Redacts sensitive value.
Java’s toString(): the source and
type render as their Java constant names (a missing type as null), and
the synonyms as Java’s AbstractCollection.toString() renders the list
([a, b], [] when empty), each synonym through its own Display.
Source§impl Hash for ConfigEntry
impl Hash for ConfigEntry
Source§impl PartialEq for ConfigEntry
impl PartialEq for ConfigEntry
impl Eq for ConfigEntry
impl StructuralPartialEq for ConfigEntry
Auto Trait Implementations§
impl Freeze for ConfigEntry
impl RefUnwindSafe for ConfigEntry
impl Send for ConfigEntry
impl Sync for ConfigEntry
impl Unpin for ConfigEntry
impl UnsafeUnpin for ConfigEntry
impl UnwindSafe for ConfigEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.