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 db2e31aa_a7bc_3c9b_da84_dcf0c56993e2["run_one()"] b3ca296d_790b_9bf3_23ea_56e5c5c48565["walk.rs"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|defined in| b3ca296d_790b_9bf3_23ea_56e5c5c48565 d4471dbf_1765_272d_947d_466868f02720["run()"] d4471dbf_1765_272d_947d_466868f02720 -->|calls| db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 4825dec2_fb68_889a_5be0_2277e9d7cb28["generate_work()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| 4825dec2_fb68_889a_5be0_2277e9d7cb28 78dc08c8_e2ba_96ff_3ae5_92c4eba84aeb["depth()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| 78dc08c8_e2ba_96ff_3ae5_92c4eba84aeb b21fb586_2077_75fc_78f6_3e590b7c2aa2["is_symlink()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| b21fb586_2077_75fc_78f6_3e590b7c2aa2 22e63b02_548b_5463_d609_2419e47f16ca["is_dir()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| 22e63b02_548b_5463_d609_2419e47f16ca b2d9feab_5e1a_a1ee_dc95_cd3038d14bc7["visit()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| b2d9feab_5e1a_a1ee_dc95_cd3038d14bc7 108dca3a_76ad_c78e_2e8e_08a7c813e095["add_parents()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| 108dca3a_76ad_c78e_2e8e_08a7c813e095 a399a32c_fcca_6278_d1fa_ab219d9cb9b8["is_quit()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| a399a32c_fcca_6278_d1fa_ab219d9cb9b8 b7c35265_4b25_7522_9716_0993b2573caf["is_same_file_system()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| b7c35265_4b25_7522_9716_0993b2573caf eaa93251_8ff2_5e1b_adef_2cb61588bdb0["path()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| eaa93251_8ff2_5e1b_adef_2cb61588bdb0 aa0cee8b_8d87_b865_b317_793adac3036f["read_dir()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| aa0cee8b_8d87_b865_b317_793adac3036f 6f0c4097_1f23_e7d7_c6ba_b48882de7005["is_continue()"] db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 -->|calls| 6f0c4097_1f23_e7d7_c6ba_b48882de7005 style db2e31aa_a7bc_3c9b_da84_dcf0c56993e2 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