[][src]Struct querable::default::DefaultTokenizer

pub struct DefaultTokenizer;

DefaultTokenizer have a format query likes :

// [0].test.[1]
// test.test.[1]

Trait Implementations

impl Tokenizer for DefaultTokenizer[src]

fn index_parse(key: &str) -> Result<usize, IndexError>[src]

Parse index array.

  • should starts and end with '[' and ']'. No space allowed.
use querable::{types::Tokenizer, default::DefaultTokenizer, error::{IndexError}};

assert_eq!(DefaultTokenizer::index_parse("[]"), Err(IndexError::ParseError(String::from("[]"))));
  • index should be an integer, specificially, in the range of usize.
use querable::{types::Tokenizer, default::DefaultTokenizer};

assert!(DefaultTokenizer::index_parse("[x]").is_err());

fn dict_parse(key: &str) -> Result<State, KeyError>[src]

Parse key/path index.

  • shouldn't be an empty string or being prefixed & suffixed with empty string.
use querable::{types::Tokenizer, default::DefaultTokenizer, error::{KeyError}};

assert_eq!(DefaultTokenizer::dict_parse("   .test"), Err(KeyError::ParseError(String::from("   "))));
assert_eq!(DefaultTokenizer::dict_parse(""), Err(KeyError::EmptyKey));

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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