[][src]Struct manaconf::KeyBuf

pub struct KeyBuf { /* fields omitted */ }

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]

type Target = Key

The resulting type after dereferencing.

impl<'a> FromIterator<&'a str> for KeyBuf[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.