Struct Parser

Source
struct Parser<'a> {
    val: &'a str,
    tokenizer: Tokenizer<'a>,
}
Expand description

Implementation of parse_data_type, modeled after https://github.com/sqlparser-rs/sqlparser-rs

Fields§

§val: &'a str§tokenizer: Tokenizer<'a>

Implementations§

Source§

impl<'a> Parser<'a>

Source

fn new(val: &'a str) -> Self

Source

fn parse(self) -> Result<DataType, ArrowError>

Source

fn parse_next_type(&mut self) -> Result<DataType, ArrowError>

parses the next full DataType

Source

fn parse_list(&mut self) -> Result<DataType, ArrowError>

Parses the List type

Source

fn parse_large_list(&mut self) -> Result<DataType, ArrowError>

Parses the LargeList type

Source

fn parse_fixed_size_list(&mut self) -> Result<DataType, ArrowError>

Parses the FixedSizeList type

Source

fn parse_time_unit(&mut self, context: &str) -> Result<TimeUnit, ArrowError>

Parses the next timeunit

Source

fn parse_timezone( &mut self, context: &str, ) -> Result<Option<String>, ArrowError>

Parses the next timezone

Source

fn parse_double_quoted_string( &mut self, context: &str, ) -> Result<String, ArrowError>

Parses the next double quoted string

Source

fn parse_i64(&mut self, context: &str) -> Result<i64, ArrowError>

Parses the next integer value

Source

fn parse_i32(&mut self, context: &str) -> Result<i32, ArrowError>

Parses the next i32 integer value

Source

fn parse_i8(&mut self, context: &str) -> Result<i8, ArrowError>

Parses the next i8 integer value

Source

fn parse_u8(&mut self, context: &str) -> Result<u8, ArrowError>

Parses the next u8 integer value

Source

fn parse_timestamp(&mut self) -> Result<DataType, ArrowError>

Parses the next timestamp (called after Timestamp has been consumed)

Source

fn parse_time32(&mut self) -> Result<DataType, ArrowError>

Parses the next Time32 (called after Time32 has been consumed)

Source

fn parse_time64(&mut self) -> Result<DataType, ArrowError>

Parses the next Time64 (called after Time64 has been consumed)

Source

fn parse_duration(&mut self) -> Result<DataType, ArrowError>

Parses the next Duration (called after Duration has been consumed)

Source

fn parse_interval(&mut self) -> Result<DataType, ArrowError>

Parses the next Interval (called after Interval has been consumed)

Source

fn parse_fixed_size_binary(&mut self) -> Result<DataType, ArrowError>

Parses the next FixedSizeBinary (called after FixedSizeBinary has been consumed)

Source

fn parse_decimal_128(&mut self) -> Result<DataType, ArrowError>

Parses the next Decimal128 (called after Decimal128 has been consumed)

Source

fn parse_decimal_256(&mut self) -> Result<DataType, ArrowError>

Parses the next Decimal256 (called after Decimal256 has been consumed)

Source

fn parse_dictionary(&mut self) -> Result<DataType, ArrowError>

Parses the next Dictionary (called after Dictionary has been consumed)

Source

fn next_token(&mut self) -> Result<Token, ArrowError>

return the next token, or an error if there are none left

Source

fn expect_token(&mut self, tok: Token) -> Result<(), ArrowError>

consume the next token, returning OK(()) if it matches tok, and Err if not

Trait Implementations§

Source§

impl<'a> Debug for Parser<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Parser<'a>

§

impl<'a> RefUnwindSafe for Parser<'a>

§

impl<'a> Send for Parser<'a>

§

impl<'a> Sync for Parser<'a>

§

impl<'a> Unpin for Parser<'a>

§

impl<'a> UnwindSafe for Parser<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.