pub struct ConfigSection(/* private fields */);Expand description
A validated configuration section name.
Implementations§
Source§impl ConfigSection
impl ConfigSection
Sourcepub fn new(input: impl AsRef<str>) -> Result<ConfigSection, ConfigKeyError>
pub fn new(input: impl AsRef<str>) -> Result<ConfigSection, ConfigKeyError>
Creates a configuration section from one non-empty segment.
§Errors
Returns ConfigKeyError when the input is empty after trimming or contains a dot.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the owned section string.
Trait Implementations§
Source§impl Clone for ConfigSection
impl Clone for ConfigSection
Source§fn clone(&self) -> ConfigSection
fn clone(&self) -> ConfigSection
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 ConfigSection
impl Debug for ConfigSection
Source§impl Display for ConfigSection
impl Display for ConfigSection
Source§impl FromStr for ConfigSection
impl FromStr for ConfigSection
Source§type Err = ConfigKeyError
type Err = ConfigKeyError
The associated error which can be returned from parsing.
Source§fn from_str(
input: &str,
) -> Result<ConfigSection, <ConfigSection as FromStr>::Err>
fn from_str( input: &str, ) -> Result<ConfigSection, <ConfigSection as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for ConfigSection
impl Hash for ConfigSection
Source§impl Ord for ConfigSection
impl Ord for ConfigSection
Source§fn cmp(&self, other: &ConfigSection) -> Ordering
fn cmp(&self, other: &ConfigSection) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ConfigSection
impl PartialEq for ConfigSection
Source§fn eq(&self, other: &ConfigSection) -> bool
fn eq(&self, other: &ConfigSection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ConfigSection
impl PartialOrd for ConfigSection
impl Eq for ConfigSection
impl StructuralPartialEq for ConfigSection
Auto Trait Implementations§
impl Freeze for ConfigSection
impl RefUnwindSafe for ConfigSection
impl Send for ConfigSection
impl Sync for ConfigSection
impl Unpin for ConfigSection
impl UnsafeUnpin for ConfigSection
impl UnwindSafe for ConfigSection
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