[−][src]Struct manaconf::KeyBuf
KeyBuf
is the owned version of a Key
.
It is to Key
as PathBuf
is to Path
Implementations
impl KeyBuf
[src]
pub fn new() -> Self
[src]
Creates an empty KeyBuf
pub fn push<K: AsRef<Key>>(&mut self, value: K)
[src]
Pushes a component or series of components into the key
Example
let mut buf = KeyBuf::new(); buf.push("config"); buf.push("section"); buf.push("subsection::item"); buf.push(Key::new("database::host")); assert_eq!(buf.as_str(), "config::section::subsection::item::database::host");
Methods from Deref<Target = Key>
pub fn components<'a>(&'a self) -> Components<'a>
[src]
Gets an iterator over the key's components
pub fn to_key_buf(&self) -> KeyBuf
[src]
Creates a KeyBuf
from the current Key
pub fn start_with<K: AsRef<Key>>(&self, prefix: K) -> bool
[src]
Determines if the current key starts with a given prefix
pub fn strip_prefix<K: AsRef<Key>>(&self, prefix: K) -> KeyBuf
[src]
Strips the given prefix
from the key and returns the modfied key as a
KeyBuf
pub fn _strip_prefix(&self, prefix: &Key) -> KeyBuf
[src]
pub fn extend_with_suffix<K: AsRef<Key>>(&self, suffix: K) -> KeyBuf
[src]
pub fn as_str(&self) -> &str
[src]
Gets a representation of the key as as a &str
pub fn to_string_with_seperator(&self, seperator: &str) -> String
[src]
Trait Implementations
impl AsRef<Key> for KeyBuf
[src]
impl Borrow<Key> for KeyBuf
[src]
impl Clone for KeyBuf
[src]
impl Debug for KeyBuf
[src]
impl Deref for KeyBuf
[src]
impl<'a> FromIterator<&'a str> for KeyBuf
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = &'a str>,
[src]
T: IntoIterator<Item = &'a str>,
Auto Trait Implementations
impl RefUnwindSafe for KeyBuf
impl Send for KeyBuf
impl Sync for KeyBuf
impl Unpin for KeyBuf
impl UnwindSafe for KeyBuf
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,