visit() — tailwindcss Function Reference
Architecture documentation for the visit() function in walk.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD c86808e9_e9bf_ba3a_5066_e8e86b62e340["visit()"] 8e317b24_544c_86ea_6c34_a553bcd66719["visit()"] 8e317b24_544c_86ea_6c34_a553bcd66719 -->|calls| c86808e9_e9bf_ba3a_5066_e8e86b62e340 eb99f5fb_1d3e_ce79_03e0_e91929c93191["run()"] eb99f5fb_1d3e_ce79_03e0_e91929c93191 -->|calls| c86808e9_e9bf_ba3a_5066_e8e86b62e340 4f505d28_f11c_3e96_a618_a6055c35ce42["threads()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 4f505d28_f11c_3e96_a618_a6055c35ce42 8e317b24_544c_86ea_6c34_a553bcd66719["visit()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 8e317b24_544c_86ea_6c34_a553bcd66719 a6843842_f355_8b58_6480_56e7a52c15a4["new_stdin()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| a6843842_f355_8b58_6480_56e7a52c15a4 16c75919_5b4a_5654_6957_956f83d8171d["device_num()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 16c75919_5b4a_5654_6957_956f83d8171d 96663802_3a52_10d7_ed0f_14b4a337d307["is_quit()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 96663802_3a52_10d7_ed0f_14b4a337d307 60ca1299_5a36_c331_ab0a_e448cb652dda["from_path()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 60ca1299_5a36_c331_ab0a_e448cb652dda 5a0a72d6_9d9b_6ed4_1f29_398afd0992e4["new_raw()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 5a0a72d6_9d9b_6ed4_1f29_398afd0992e4 2fcdc00d_9979_79c1_5408_d697c67c1905["push()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 2fcdc00d_9979_79c1_5408_d697c67c1905 89168aff_5361_e310_017c_2b23f665da52["new_for_each_thread()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| 89168aff_5361_e310_017c_2b23f665da52 eb99f5fb_1d3e_ce79_03e0_e91929c93191["run()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| eb99f5fb_1d3e_ce79_03e0_e91929c93191 fd19ea95_aa1a_3913_b2b0_b4d4bbdcfc65["build()"] c86808e9_e9bf_ba3a_5066_e8e86b62e340 -->|calls| fd19ea95_aa1a_3913_b2b0_b4d4bbdcfc65 style c86808e9_e9bf_ba3a_5066_e8e86b62e340 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/ignore/src/walk.rs lines 1344–1418
pub fn visit(mut self, builder: &mut dyn ParallelVisitorBuilder<'_>) {
let threads = self.threads();
let mut stack = vec![];
{
let mut visitor = builder.build();
let mut paths = Vec::new().into_iter();
std::mem::swap(&mut paths, &mut self.paths);
// Send the initial set of root paths to the pool of workers. Note
// that we only send directories. For files, we send to them the
// callback directly.
for path in paths {
let (dent, root_device) = if path == Path::new("-") {
(DirEntry::new_stdin(), None)
} else {
let root_device = if !self.same_file_system {
None
} else {
match device_num(&path) {
Ok(root_device) => Some(root_device),
Err(err) => {
let err = Error::Io(err).with_path(path);
if visitor.visit(Err(err)).is_quit() {
return;
}
continue;
}
}
};
match DirEntryRaw::from_path(0, path, false) {
Ok(dent) => (DirEntry::new_raw(dent, None), root_device),
Err(err) => {
if visitor.visit(Err(err)).is_quit() {
return;
}
continue;
}
}
};
stack.push(Message::Work(Work {
dent,
ignore: self.ig_root.clone(),
root_device,
}));
}
// ... but there's no need to start workers if we don't need them.
if stack.is_empty() {
return;
}
}
// Create the workers and then wait for them to finish.
let quit_now = Arc::new(AtomicBool::new(false));
let active_workers = Arc::new(AtomicUsize::new(threads));
let stacks = Stack::new_for_each_thread(threads, stack);
std::thread::scope(|s| {
let handles: Vec<_> = stacks
.into_iter()
.map(|stack| Worker {
visitor: builder.build(),
stack,
quit_now: quit_now.clone(),
active_workers: active_workers.clone(),
max_depth: self.max_depth,
min_depth: self.min_depth,
max_filesize: self.max_filesize,
follow_links: self.follow_links,
skip: self.skip.clone(),
filter: self.filter.clone(),
})
.map(|worker| s.spawn(|| worker.run()))
.collect();
for handle in handles {
handle.join().unwrap();
}
});
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does visit() do?
visit() is a function in the tailwindcss codebase.
What does visit() call?
visit() calls 11 function(s): build, device_num, from_path, is_quit, new_for_each_thread, new_raw, new_stdin, push, and 3 more.
What calls visit()?
visit() is called by 2 function(s): run, visit.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free