#[repr(u16)]pub enum PrimitiveType {
Void = 0,
Node = 1,
String = 2,
}Expand description
Primitive type enumeration.
These are the builtin scalar types that don’t require additional metadata in the type table.
Variants§
Void = 0
Produces nothing, transparent to parent scope.
Node = 1
A tree-sitter AST node reference.
String = 2
Extracted text from a node.
Implementations§
Source§impl PrimitiveType
impl PrimitiveType
Sourcepub fn from_index(index: u16) -> Option<Self>
pub fn from_index(index: u16) -> Option<Self>
Try to convert a type index to a primitive type.
Sourcepub fn is_builtin(index: u16) -> bool
pub fn is_builtin(index: u16) -> bool
Check if a type index is a builtin primitive.
Trait Implementations§
Source§impl Clone for PrimitiveType
impl Clone for PrimitiveType
Source§fn clone(&self) -> PrimitiveType
fn clone(&self) -> PrimitiveType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrimitiveType
Source§impl Debug for PrimitiveType
impl Debug for PrimitiveType
impl Eq for PrimitiveType
Source§impl Hash for PrimitiveType
impl Hash for PrimitiveType
Source§impl PartialEq for PrimitiveType
impl PartialEq for PrimitiveType
Source§fn eq(&self, other: &PrimitiveType) -> bool
fn eq(&self, other: &PrimitiveType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrimitiveType
Auto Trait Implementations§
impl Freeze for PrimitiveType
impl RefUnwindSafe for PrimitiveType
impl Send for PrimitiveType
impl Sync for PrimitiveType
impl Unpin for PrimitiveType
impl UnsafeUnpin for PrimitiveType
impl UnwindSafe for PrimitiveType
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.