run_one() — tailwindcss Function Reference
Architecture documentation for the run_one() function in walk.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 04e8d630_da3f_f0a4_57a8_0bd018070b1a["run_one()"] 8031325b_dcd2_8c49_70e7_46191ce03a79["walk.rs"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|defined in| 8031325b_dcd2_8c49_70e7_46191ce03a79 3945042b_2431_cd64_6a3a_fcd4f3c6aab3["run()"] 3945042b_2431_cd64_6a3a_fcd4f3c6aab3 -->|calls| 04e8d630_da3f_f0a4_57a8_0bd018070b1a dc874db4_e8a3_5292_d49c_2245b8b18f45["generate_work()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| dc874db4_e8a3_5292_d49c_2245b8b18f45 81a81328_f9d1_4939_ace7_0cf7fd2523a1["depth()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| 81a81328_f9d1_4939_ace7_0cf7fd2523a1 b285c11e_be54_1a5d_97fd_6b377476305a["is_symlink()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| b285c11e_be54_1a5d_97fd_6b377476305a 1f3047bd_cab3_dab1_e7b5_f7ef13815e23["is_dir()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| 1f3047bd_cab3_dab1_e7b5_f7ef13815e23 da7185cc_deeb_42bc_cc20_4a3139551ba0["visit()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| da7185cc_deeb_42bc_cc20_4a3139551ba0 b31162da_3a9c_3d21_bcce_888d5bb5105b["add_parents()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| b31162da_3a9c_3d21_bcce_888d5bb5105b 6a93ffd7_6fd3_eaad_cbbb_f466e658bff8["is_quit()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| 6a93ffd7_6fd3_eaad_cbbb_f466e658bff8 845aad20_2657_11d4_b218_5244fcd955d2["is_same_file_system()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| 845aad20_2657_11d4_b218_5244fcd955d2 934d114d_964b_414a_2b41_82e8174b7c3d["path()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| 934d114d_964b_414a_2b41_82e8174b7c3d c3928b53_09b6_abd6_e1af_169ef4b220b7["read_dir()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| c3928b53_09b6_abd6_e1af_169ef4b220b7 f72ba4c9_8844_ef51_3824_62d84fc9edab["is_continue()"] 04e8d630_da3f_f0a4_57a8_0bd018070b1a -->|calls| f72ba4c9_8844_ef51_3824_62d84fc9edab style 04e8d630_da3f_f0a4_57a8_0bd018070b1a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/ignore/src/walk.rs lines 1627–1700
fn run_one(&mut self, mut work: Work) -> WalkState {
let should_visit = self
.min_depth
.map(|min_depth| work.dent.depth() >= min_depth)
.unwrap_or(true);
// If the work is not a directory, then we can just execute the
// caller's callback immediately and move on.
if work.is_symlink() || !work.is_dir() {
return if should_visit {
self.visitor.visit(Ok(work.dent))
} else {
WalkState::Continue
};
}
if let Some(err) = work.add_parents() {
let state = self.visitor.visit(Err(err));
if state.is_quit() {
return state;
}
}
let descend = if let Some(root_device) = work.root_device {
match is_same_file_system(root_device, work.dent.path()) {
Ok(true) => true,
Ok(false) => false,
Err(err) => {
let state = self.visitor.visit(Err(err));
if state.is_quit() {
return state;
}
false
}
}
} else {
true
};
// Try to read the directory first before we transfer ownership
// to the provided closure. Do not unwrap it immediately, though,
// as we may receive an `Err` value e.g. in the case when we do not
// have sufficient read permissions to list the directory.
// In that case we still want to provide the closure with a valid
// entry before passing the error value.
let readdir = work.read_dir();
let depth = work.dent.depth();
if should_visit {
let state = self.visitor.visit(Ok(work.dent));
if !state.is_continue() {
return state;
}
}
if !descend {
return WalkState::Skip;
}
let readdir = match readdir {
Ok(readdir) => readdir,
Err(err) => {
return self.visitor.visit(Err(err));
}
};
if self.max_depth.map_or(false, |max| depth >= max) {
return WalkState::Skip;
}
for result in readdir {
let state = self.generate_work(&work.ignore, depth + 1, work.root_device, result);
if state.is_quit() {
return state;
}
}
WalkState::Continue
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does run_one() do?
run_one() is a function in the tailwindcss codebase, defined in crates/ignore/src/walk.rs.
Where is run_one() defined?
run_one() is defined in crates/ignore/src/walk.rs at line 1627.
What does run_one() call?
run_one() calls 11 function(s): add_parents, depth, generate_work, is_continue, is_dir, is_quit, is_same_file_system, is_symlink, and 3 more.
What calls run_one()?
run_one() is called by 1 function(s): run.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free