pub struct Token<'a> {
pub kind: TokenType,
pub value: Cow<'a, [u8]>,
pub position: usize,
}Expand description
One token: its type, its text and its byte position in the SQL.
The value is bytes, as PHP’s strings are: a character the tokenizer does
not know outside quotes is one operator token per byte, so a multi-byte
UTF-8 character becomes several tokens that are not UTF-8 on their own
(Token::text reads a value as text). It borrows the SQL text, except
for keywords, NULL and booleans (upper-cased) and tokens of MySQL SQL
whose # comments were rewritten.
PHP: Utopia\Query\Tokenizer\Token (type, value, position).
Fields§
§kind: TokenTypeWhat the token is.
PHP: $type.
value: Cow<'a, [u8]>Its text.
PHP: $value.
position: usizeIts byte offset in the SQL.
PHP: $position.
Implementations§
Trait Implementations§
impl<'a> Eq for Token<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Forget for Token<'a>
impl<'a> Freeze for Token<'a>
impl<'a> Move for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnsafeUnpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.