struct Finder<'a> {
config: &'a Config,
found: Found,
awaited: usize,
sync: bool,
quiet: bool,
chained: HashSet<usize>,
}Fields§
§config: &'a Config§found: Found§awaited: usizeDepth of .await bases being visited: method chains count as service calls only there.
sync: boolSynchronous code: method chains and free functions count as service calls everywhere.
quiet: boolClassifying a synchronous call: a call without a verb is no effect and no report.
chained: HashSet<usize>Method calls already classified as part of a longer chain (by address).
Implementations§
Source§impl Finder<'_>
impl Finder<'_>
Sourcefn fact(&mut self, span: Span, ident: &str, args: &[&Expr]) -> bool
fn fact(&mut self, span: Span, ident: &str, args: &[&Expr]) -> bool
Use the compiler’s facts for the call of ident at span, if there are any. Returns
true when they are complete (the compiler saw through every callee), so the name’s guess
is not needed.
args are the call’s arguments as written, a method’s receiver first: an effect the
compiler found on the callee’s parameter j acts on what args[j] names.
Sourcefn fact_full(&mut self, span: Span, ident: &str, args: &[&Expr]) -> Option<bool>
fn fact_full(&mut self, span: Span, ident: &str, args: &[&Expr]) -> Option<bool>
Like Self::fact, but distinguishes “no fact” (None) from “opaque fact”
(Some(false)).
Sourcefn callee_name(c: &ExprCall) -> Option<String>
fn callee_name(c: &ExprCall) -> Option<String>
The last identifier of a called path (stamp in helpers::stamp(..)).
fn push( &mut self, domain: Domain, kind: Kind, target: Target, op: String, ordered: bool, )
Sourcefn sourced(&mut self, arg: Option<&Expr>)
fn sourced(&mut self, arg: Option<&Expr>)
Record the expression the last effect’s target was taken from.
Sourcefn path_call(&mut self, c: &ExprCall) -> bool
fn path_call(&mut self, c: &ExprCall) -> bool
std::fs::write(p, ..), File::create(p), env::set_var(..), Command::new(..), and
awaited free functions named by a verb.
fn unclassified(&mut self, op: String)
Sourcefn awaited_chain(&mut self, base: &Expr)
fn awaited_chain(&mut self, base: &Expr)
An awaited method chain recv.a(..).b(..).c(..): the first method with a known verb
decides, so client.get(url).send() reads and s3.put_object().key(k).send() writes.
Source§impl Finder<'_>
impl Finder<'_>
Sourcefn redis_of_chain<'a>(
&self,
root: &Expr,
calls: &[&'a ExprMethodCall],
) -> Option<(Kind, bool, String, Target, Option<&'a Expr>)>
fn redis_of_chain<'a>( &self, root: &Expr, calls: &[&'a ExprMethodCall], ) -> Option<(Kind, bool, String, Target, Option<&'a Expr>)>
redis::cmd("HGET").arg(key)..: the command’s kind, whether its order is visible, and the
first .arg(..) as the target, with its expression. An unknown command may do anything,
so it writes.