pub struct FunctionSpec {
pub name: String,
pub role: Option<Role>,
pub pure: Option<bool>,
pub noreturn: Option<bool>,
pub disabled: Option<bool>,
pub params: Vec<ParamSpec>,
pub returns: Option<ReturnSpec>,
pub taint: Option<TaintSpec>,
}Expand description
A function specification describing external/library function behavior.
All fields are optional except name. Analyses use safe defaults when fields
are missing. See the design doc for default behavior per field.
Fields§
§name: StringFunction name or pattern. Use glob: or regex: prefix for pattern matching.
role: Option<Role>High-level role of this function (e.g., allocator, source, sink).
pure: Option<bool>Function has no side effects; result depends only on inputs.
noreturn: Option<bool>Function never returns (e.g., exit, abort, longjmp).
disabled: Option<bool>Suppress an inherited spec from a lower-priority source.
params: Vec<ParamSpec>Per-parameter specifications.
returns: Option<ReturnSpec>Return value specification.
taint: Option<TaintSpec>Taint propagation rules.
Implementations§
Source§impl FunctionSpec
impl FunctionSpec
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if this spec is disabled.
Sourcepub fn is_noreturn(&self) -> bool
pub fn is_noreturn(&self) -> bool
Check if function never returns.
Sourcepub fn param(&self, index: u32) -> Option<&ParamSpec>
pub fn param(&self, index: u32) -> Option<&ParamSpec>
Get the spec for a specific parameter by index.
Sourcepub fn merge(&mut self, other: &FunctionSpec)
pub fn merge(&mut self, other: &FunctionSpec)
Merge another spec into this one (other overrides self for present fields).
Trait Implementations§
Source§impl Clone for FunctionSpec
impl Clone for FunctionSpec
Source§fn clone(&self) -> FunctionSpec
fn clone(&self) -> FunctionSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more