pub trait LangSpec: Sync {
Show 17 methods
// Required methods
fn receiver(&self) -> &'static str;
fn def(
&self,
node: Node<'_>,
src: &[u8],
in_class: bool,
) -> Option<(SymbolKind, String)>;
fn variable(&self, node: Node<'_>, src: &[u8]) -> Option<String>;
fn import(&self, node: Node<'_>, src: &[u8]) -> Option<Vec<Import>>;
fn reference(
&self,
node: Node<'_>,
src: &[u8],
) -> Option<(RefKind, Vec<String>)>;
fn assignment(
&self,
node: Node<'_>,
src: &[u8],
) -> Option<(Target, TypeSource)>;
fn bases(&self, def: Node<'_>, src: &[u8]) -> Vec<(RefKind, Vec<String>)>;
fn returns(&self, def: Node<'_>, src: &[u8]) -> Option<Vec<String>>;
fn params(
&self,
def: Node<'_>,
src: &[u8],
) -> Vec<(String, Vec<String>, bool)>;
// Provided methods
fn owned_bases(
&self,
_node: Node<'_>,
_src: &[u8],
) -> Option<(String, RefKind, Vec<String>)> { ... }
fn contract(&self, _node: Node<'_>, _src: &[u8]) -> Option<RawContract> { ... }
fn contracts(&self, node: Node<'_>, src: &[u8]) -> Vec<RawContract> { ... }
fn param_names(&self, _def: Node<'_>, _src: &[u8]) -> Vec<String> { ... }
fn call(&self, _node: Node<'_>, _src: &[u8]) -> Option<(Vec<String>, Args)> { ... }
fn value(&self, _node: Node<'_>, _src: &[u8]) -> Option<(String, ValueExpr)> { ... }
fn package(&self, _root: Node<'_>, _src: &[u8]) -> Option<String> { ... }
fn owner(&self, _def: Node<'_>, _src: &[u8]) -> Option<String> { ... }
}Required Methods§
Sourcefn def(
&self,
node: Node<'_>,
src: &[u8],
in_class: bool,
) -> Option<(SymbolKind, String)>
fn def( &self, node: Node<'_>, src: &[u8], in_class: bool, ) -> Option<(SymbolKind, String)>
A definition node: its kind and name. in_class is true directly inside a class body.
Sourcefn variable(&self, node: Node<'_>, src: &[u8]) -> Option<String>
fn variable(&self, node: Node<'_>, src: &[u8]) -> Option<String>
A module-level variable binding’s name (only asked at module scope).
Sourcefn import(&self, node: Node<'_>, src: &[u8]) -> Option<Vec<Import>>
fn import(&self, node: Node<'_>, src: &[u8]) -> Option<Vec<Import>>
Some for an import/re-export statement (not descended into), possibly empty.
Sourcefn reference(
&self,
node: Node<'_>,
src: &[u8],
) -> Option<(RefKind, Vec<String>)>
fn reference( &self, node: Node<'_>, src: &[u8], ) -> Option<(RefKind, Vec<String>)>
A call or construction and the dotted path of its callee.
Sourcefn assignment(&self, node: Node<'_>, src: &[u8]) -> Option<(Target, TypeSource)>
fn assignment(&self, node: Node<'_>, src: &[u8]) -> Option<(Target, TypeSource)>
An assignment (or field declaration) whose target type can be inferred.
Sourcefn bases(&self, def: Node<'_>, src: &[u8]) -> Vec<(RefKind, Vec<String>)>
fn bases(&self, def: Node<'_>, src: &[u8]) -> Vec<(RefKind, Vec<String>)>
Base classes / implemented interfaces of a class-like definition.
Provided Methods§
Sourcefn owned_bases(
&self,
_node: Node<'_>,
_src: &[u8],
) -> Option<(String, RefKind, Vec<String>)>
fn owned_bases( &self, _node: Node<'_>, _src: &[u8], ) -> Option<(String, RefKind, Vec<String>)>
A base declared apart from the type (Rust impl Trait for Type): (type name, kind, base).
Sourcefn contract(&self, _node: Node<'_>, _src: &[u8]) -> Option<RawContract>
fn contract(&self, _node: Node<'_>, _src: &[u8]) -> Option<RawContract>
Contract syntax at this node (routes, client construction, service operations).
Sourcefn contracts(&self, node: Node<'_>, src: &[u8]) -> Vec<RawContract>
fn contracts(&self, node: Node<'_>, src: &[u8]) -> Vec<RawContract>
Every contract at this node (a router line can register several verbs).
Sourcefn param_names(&self, _def: Node<'_>, _src: &[u8]) -> Vec<String>
fn param_names(&self, _def: Node<'_>, _src: &[u8]) -> Vec<String>
Parameter names of a callable in order, receiver excluded.
Sourcefn call(&self, _node: Node<'_>, _src: &[u8]) -> Option<(Vec<String>, Args)>
fn call(&self, _node: Node<'_>, _src: &[u8]) -> Option<(Vec<String>, Args)>
A call with at least one statically readable argument: callee path and arguments.
Sourcefn value(&self, _node: Node<'_>, _src: &[u8]) -> Option<(String, ValueExpr)>
fn value(&self, _node: Node<'_>, _src: &[u8]) -> Option<(String, ValueExpr)>
name = <statically known value> at module or class level.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".