pub struct DefinitionText {
pub signature: String,
pub body: String,
pub doc_comment: Option<String>,
pub start_byte: u32,
pub end_byte: u32,
}Expand description
Source-text capture for a node — signature, body slice, preceding doc-comment, and byte range into the original file. Filled during pass 1 from the tree-sitter node’s byte range; cheap (no extra parsing).
Powers wiki rendering, tour narration, and future semantic search. Empty default means “not captured” — legacy rows return all-empty.
Fields§
§signature: StringFirst line(s) of the definition up to (and excluding) the body block.
E.g. pub fn apply_diff(&mut self, branch: &str, diff: &GraphDiff) -> Result<()>.
body: StringFull source slice of the node, including signature and body.
doc_comment: Option<String>Doc-comment immediately preceding the node (///, //!, /** */, """).
None when absent.
start_byte: u32Byte offsets into the parent file. (0, 0) if not captured.
end_byte: u32Trait Implementations§
Source§impl Clone for DefinitionText
impl Clone for DefinitionText
Source§fn clone(&self) -> DefinitionText
fn clone(&self) -> DefinitionText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefinitionText
impl Debug for DefinitionText
Source§impl Default for DefinitionText
impl Default for DefinitionText
Source§fn default() -> DefinitionText
fn default() -> DefinitionText
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DefinitionText
impl<'de> Deserialize<'de> for DefinitionText
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
impl Eq for DefinitionText
Source§impl PartialEq for DefinitionText
impl PartialEq for DefinitionText
Source§fn eq(&self, other: &DefinitionText) -> bool
fn eq(&self, other: &DefinitionText) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DefinitionText
impl Serialize for DefinitionText
impl StructuralPartialEq for DefinitionText
Auto Trait Implementations§
impl Freeze for DefinitionText
impl RefUnwindSafe for DefinitionText
impl Send for DefinitionText
impl Sync for DefinitionText
impl Unpin for DefinitionText
impl UnsafeUnpin for DefinitionText
impl UnwindSafe for DefinitionText
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