pub struct Function {
pub name: String,
pub is_public: bool,
pub is_async: bool,
pub line: usize,
pub end_line: usize,
pub parameters: Vec<String>,
pub doc_comment: Option<String>,
}Expand description
A function or method definition.
Fields§
§name: String§is_public: bool§is_async: bool§line: usize§end_line: usize§parameters: Vec<String>Parameter names extracted by tree-sitter (empty if not yet extracted).
doc_comment: Option<String>Doc comment / docstring attached to this function.
- Rust: consecutive
///lines immediately preceding the function. - Python: triple-quoted string as the first statement of the body.
- TypeScript/JavaScript: JSDoc
/** ... */comment preceding the function.
None when absent or when the parser has not yet been updated.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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