pub struct AstResponse {
pub id: String,
pub language: String,
pub root: Option<AstNode>,
}Expand description
The response of an AST request.
The envelope echoes the resolved language slug alongside id and
root, matching the /function, /comment, and /metrics analysis
endpoints (#654). AST node kinds are grammar-specific, so an /ast
consumer most needs to confirm which grammar actually parsed the
source. language is the #540 canonical lowercase slug (the same value
the sibling endpoints emit). The added field is a 2.0-line shape
change to this published library type (STABILITY.md).
Fields§
§id: StringThe id associated to a request for an AST
language: StringThe resolved source-language slug that produced this tree (#654).
The #540 canonical lowercase slug (e.g. cpp, python), matching
the other analysis endpoints’ language echo.
root: Option<AstNode>The root node of an AST
If None, an error has occurred
Trait Implementations§
Source§impl Debug for AstResponse
impl Debug for AstResponse
Auto Trait Implementations§
impl Freeze for AstResponse
impl RefUnwindSafe for AstResponse
impl Send for AstResponse
impl Sync for AstResponse
impl Unpin for AstResponse
impl UnsafeUnpin for AstResponse
impl UnwindSafe for AstResponse
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