[][src]Struct log::key_values::Key

pub struct Key<'k> { /* fields omitted */ }

The key in a key-value pair.

The Key type abstracts over owned or borrowed keys.

Methods

impl<'k> Key<'k>[src]

pub fn from_owned(
    key: impl Into<String>,
    index: Option<usize>
) -> Self
[src]

Create a key from an owned string and optional index.

impl<'k> Key<'k>[src]

pub fn from_str(
    key: &'k impl Borrow<str> + ?Sized,
    index: Option<usize>
) -> Self
[src]

Create a key from a borrowed string and optional index.

pub fn index(&self) -> Option<usize>[src]

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl<'k> ToKey for Key<'k>[src]

impl<'k> AsRef<str> for Key<'k>[src]

impl<'k> PartialEq<Key<'k>> for Key<'k>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<'k> From<&'k str> for Key<'k>[src]

impl<'k> From<String> for Key<'k>[src]

impl<'k> Ord for Key<'k>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<'k> Eq for Key<'k>[src]

impl<'k> PartialOrd<Key<'k>> for Key<'k>[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'k> Debug for Key<'k>[src]

impl<'k> Display for Key<'k>[src]

impl<'k> Hash for Key<'k>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'k> Borrow<str> for Key<'k>[src]

impl<'k> Serialize for Key<'k>[src]

impl<'k> Value for Key<'k>[src]

Auto Trait Implementations

impl<'k> Send for Key<'k>

impl<'k> Sync for Key<'k>

Blanket Implementations

impl<T> From for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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