pub struct ParserCompletionEvidence { /* private fields */ }Expand description
Small bounded structural evidence returned instead of a syntax tree.
Implementations§
Source§impl ParserCompletionEvidence
impl ParserCompletionEvidence
Sourcepub fn new(
root_kind: ParserSyntaxKind,
root_start_byte: u32,
root_end_byte: u32,
root_has_error: bool,
named_node_count: u32,
error_node_count: u32,
missing_node_count: u32,
maximum_depth: u32,
) -> Result<Self, ParserProtocolError>
pub fn new( root_kind: ParserSyntaxKind, root_start_byte: u32, root_end_byte: u32, root_has_error: bool, named_node_count: u32, error_node_count: u32, missing_node_count: u32, maximum_depth: u32, ) -> Result<Self, ParserProtocolError>
Construct bounded structural evidence.
§Errors
Returns an error for an inverted range or a hard count/depth overflow.
Sourcepub fn validate_for(
&self,
request: &ParserRequest,
) -> Result<(), ParserProtocolError>
pub fn validate_for( &self, request: &ParserRequest, ) -> Result<(), ParserProtocolError>
Validate evidence against request-specific source and structural limits.
§Errors
Returns an error when the range, node count, or depth exceeds the request.
Sourcepub const fn root_kind(&self) -> &ParserSyntaxKind
pub const fn root_kind(&self) -> &ParserSyntaxKind
Borrow the exact root syntax kind.
Sourcepub const fn root_start_byte(&self) -> u32
pub const fn root_start_byte(&self) -> u32
Return the root start byte.
Sourcepub const fn root_end_byte(&self) -> u32
pub const fn root_end_byte(&self) -> u32
Return the root end byte.
Sourcepub const fn root_has_error(&self) -> bool
pub const fn root_has_error(&self) -> bool
Return the exact Tree-sitter root error state.
Sourcepub const fn named_node_count(&self) -> u32
pub const fn named_node_count(&self) -> u32
Return the named structural-node count.
Sourcepub const fn error_node_count(&self) -> u32
pub const fn error_node_count(&self) -> u32
Return the error-node count.
Sourcepub const fn missing_node_count(&self) -> u32
pub const fn missing_node_count(&self) -> u32
Return the missing-node count.
Sourcepub const fn maximum_depth(&self) -> u32
pub const fn maximum_depth(&self) -> u32
Return the maximum observed structural depth.
Trait Implementations§
Source§impl Clone for ParserCompletionEvidence
impl Clone for ParserCompletionEvidence
Source§fn clone(&self) -> ParserCompletionEvidence
fn clone(&self) -> ParserCompletionEvidence
Returns a duplicate of the value. Read more
1.0.0 · 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 ParserCompletionEvidence
impl Debug for ParserCompletionEvidence
Source§impl<'de> Deserialize<'de> for ParserCompletionEvidence
impl<'de> Deserialize<'de> for ParserCompletionEvidence
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
Source§impl PartialEq for ParserCompletionEvidence
impl PartialEq for ParserCompletionEvidence
Source§impl Serialize for ParserCompletionEvidence
impl Serialize for ParserCompletionEvidence
impl Eq for ParserCompletionEvidence
impl StructuralPartialEq for ParserCompletionEvidence
Auto Trait Implementations§
impl Freeze for ParserCompletionEvidence
impl RefUnwindSafe for ParserCompletionEvidence
impl Send for ParserCompletionEvidence
impl Sync for ParserCompletionEvidence
impl Unpin for ParserCompletionEvidence
impl UnwindSafe for ParserCompletionEvidence
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.