[][src]Enum object_query::Query

pub enum Query<'a> {
    Index {
        index: usize,
        from_last: bool,
    },
    Key(Cow<'a, str>),
}

Either a key or an index query

Variants

Index

The index query. Represents the index (starting at 0) from either the front or the back

Fields of Index

index: usizefrom_last: bool
Key(Cow<'a, str>)

The key query. Represents string key to query by

Implementations

impl Query<'static>[src]

pub fn index(index: usize) -> Self[src]

Create an index query from the front

pub fn index_from_last(index: usize) -> Self[src]

Create an index query from the back

pub fn key_owned(key: String) -> Self[src]

Create a owned key query

impl<'a> Query<'a>[src]

pub fn key(key: &'a str) -> Self[src]

Create a borrowed key query

pub fn is_from_last(&self) -> bool[src]

Is an index query from the back

pub fn is_key(&self) -> bool[src]

Is a key query

pub fn is_index(&self) -> bool[src]

Is an index query

pub fn as_key(&self) -> Option<&str>[src]

Return the string reference if it is a key query

pub fn as_index(&self) -> Option<i64>[src]

Returns an i64 representation of the index if it is a index query. This is either the index or 0 - index - 1 for an index from the back

pub fn to_owned(&self) -> Query<'static>[src]

An alternative to the std::borrow::ToOwned method

Trait Implementations

impl<'a> Clone for Query<'a>[src]

impl<'a> Debug for Query<'a>[src]

impl<'a> Eq for Query<'a>[src]

impl<'a> From<&'a str> for Query<'a>[src]

impl From<String> for Query<'static>[src]

impl From<i16> for Query<'static>[src]

impl From<i32> for Query<'static>[src]

impl From<i64> for Query<'static>[src]

impl From<i8> for Query<'static>[src]

impl From<isize> for Query<'static>[src]

impl From<u16> for Query<'static>[src]

impl From<u32> for Query<'static>[src]

impl From<u64> for Query<'static>[src]

impl From<u8> for Query<'static>[src]

impl From<usize> for Query<'static>[src]

impl<'a> PartialEq<Query<'a>> for Query<'a>[src]

impl<'a> StructuralEq for Query<'a>[src]

impl<'a> StructuralPartialEq for Query<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Query<'a>

impl<'a> Send for Query<'a>

impl<'a> Sync for Query<'a>

impl<'a> Unpin for Query<'a>

impl<'a> UnwindSafe for Query<'a>

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.