pub enum Lang {
Rust,
TypeScript,
Tsx,
Python,
Go,
}Variants§
Implementations§
Source§impl Lang
impl Lang
pub fn from_path(path: &str) -> Option<Lang>
pub fn name(&self) -> &'static str
pub fn language(&self) -> Language
pub fn separator(&self) -> String
Sourcepub fn definition(
&self,
node: Node<'_>,
src: &str,
) -> Option<(String, &'static str)>
pub fn definition( &self, node: Node<'_>, src: &str, ) -> Option<(String, &'static str)>
Is this node a symbol definition? Returns (name, kind). The name may
be pre-qualified with :: (Go methods carry their receiver).
Sourcepub fn scope_only(&self, node: Node<'_>, src: &str) -> Option<String>
pub fn scope_only(&self, node: Node<'_>, src: &str) -> Option<String>
Containers that qualify children without being symbols themselves.
Sourcepub fn body_field(&self) -> Option<&'static str>
pub fn body_field(&self) -> Option<&'static str>
Field holding the body (cut point for signatures), per node kind.
Sourcepub fn call(&self, node: Node<'_>, src: &str) -> Option<String>
pub fn call(&self, node: Node<'_>, src: &str) -> Option<String>
If this node is a call, return the bare callee name.
Trait Implementations§
impl Copy for Lang
impl Eq for Lang
impl StructuralPartialEq for Lang
Auto Trait Implementations§
impl Freeze for Lang
impl RefUnwindSafe for Lang
impl Send for Lang
impl Sync for Lang
impl Unpin for Lang
impl UnsafeUnpin for Lang
impl UnwindSafe for Lang
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more