pub struct Node {
pub id: NodeId,
pub kind: NodeKind,
pub name: String,
pub lang: Language,
pub file: PathBuf,
pub span: Span,
pub signature: Option<String>,
pub metadata: Value,
}
Expand description
A node in the Universal AST
Fields§
§id: NodeId
Unique identifier
kind: NodeKind
Node type
name: String
Node name (e.g., class name, method name)
lang: Language
Programming language
file: PathBuf
Source file path
span: Span
Source location
signature: Option<String>
Optional type signature
metadata: Value
Additional metadata (Java-specific info like visibility, modifiers, etc.)
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
repo_id: &str,
kind: NodeKind,
name: String,
lang: Language,
file: PathBuf,
span: Span,
) -> Self
pub fn new( repo_id: &str, kind: NodeKind, name: String, lang: Language, file: PathBuf, span: Span, ) -> Self
Create a new node
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Set metadata for the node
Sourcepub fn with_signature(self, signature: String) -> Self
pub fn with_signature(self, signature: String) -> Self
Set signature for the node
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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