pub struct JavaScriptCodeInfo {Show 13 fields
pub api_calls: Vec<ApiCall>,
pub is_read_only: bool,
pub endpoints_accessed: HashSet<String>,
pub methods_used: HashSet<String>,
pub uses_async: bool,
pub variable_names: Vec<String>,
pub max_depth: usize,
pub loop_count: usize,
pub all_loops_bounded: bool,
pub violations: Vec<SafetyViolation>,
pub statement_count: usize,
pub output_declaration: OutputDeclaration,
pub has_output_spread_risk: bool,
}Expand description
Information extracted from parsed JavaScript code.
Fields§
§api_calls: Vec<ApiCall>All API calls in the code
is_read_only: boolWhether the code is read-only (only GET/HEAD/OPTIONS calls)
endpoints_accessed: HashSet<String>All endpoints accessed
methods_used: HashSet<String>All HTTP methods used
uses_async: boolWhether the code uses async/await
variable_names: Vec<String>Variable names declared
max_depth: usizeMaximum nesting depth
loop_count: usizeNumber of for…of loops
all_loops_bounded: boolWhether all loops are bounded (use .slice())
violations: Vec<SafetyViolation>Policy violations found during parsing
statement_count: usizeTotal number of statements
output_declaration: OutputDeclarationOutput declaration from @returns annotation
has_output_spread_risk: boolWhether the script contains spread operators that could leak fields
Trait Implementations§
Source§impl Clone for JavaScriptCodeInfo
impl Clone for JavaScriptCodeInfo
Source§fn clone(&self) -> JavaScriptCodeInfo
fn clone(&self) -> JavaScriptCodeInfo
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 JavaScriptCodeInfo
impl Debug for JavaScriptCodeInfo
Source§impl Default for JavaScriptCodeInfo
impl Default for JavaScriptCodeInfo
Source§fn default() -> JavaScriptCodeInfo
fn default() -> JavaScriptCodeInfo
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JavaScriptCodeInfo
impl RefUnwindSafe for JavaScriptCodeInfo
impl Send for JavaScriptCodeInfo
impl Sync for JavaScriptCodeInfo
impl Unpin for JavaScriptCodeInfo
impl UnsafeUnpin for JavaScriptCodeInfo
impl UnwindSafe for JavaScriptCodeInfo
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.