Home / Function/ generate_work() — tailwindcss Function Reference

generate_work() — tailwindcss Function Reference

Architecture documentation for the generate_work() function in walk.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  83e9692c_0ef1_97e5_4b56_90182cf80c7a["generate_work()"]
  e63c9a61_c0eb_fc8e_2a92_ab9b1af2a4db["run_one()"]
  e63c9a61_c0eb_fc8e_2a92_ab9b1af2a4db -->|calls| 83e9692c_0ef1_97e5_4b56_90182cf80c7a
  e86a1e76_3418_364b_b645_d800127a5dea["send()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| e86a1e76_3418_364b_b645_d800127a5dea
  13d86d56_4bc4_caba_fdeb_cb4a0f6102fc["from_entry()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 13d86d56_4bc4_caba_fdeb_cb4a0f6102fc
  257c924a_e97b_8a42_d7b6_020af6d65de0["new_raw()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 257c924a_e97b_8a42_d7b6_020af6d65de0
  a102b557_0cc7_5c4e_042f_24149898e7c2["is_symlink()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| a102b557_0cc7_5c4e_042f_24149898e7c2
  9cddcb8d_8667_c506_99c7_f194e438a77a["from_path()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 9cddcb8d_8667_c506_99c7_f194e438a77a
  46ac3628_51ec_72d2_94bc_be8f59e5700a["check_symlink_loop()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 46ac3628_51ec_72d2_94bc_be8f59e5700a
  461518f2_d034_3ecd_d800_8fd8eb7e27f5["should_skip_entry()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 461518f2_d034_3ecd_d800_8fd8eb7e27f5
  84f5dd61_79d6_6710_dbec_816fdb4b9a82["path_equals()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 84f5dd61_79d6_6710_dbec_816fdb4b9a82
  b9f888eb_e20e_00c4_0e27_95aa2bdddfcf["skip_filesize()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| b9f888eb_e20e_00c4_0e27_95aa2bdddfcf
  bd2e8909_e461_841f_0d61_4a0d1fd86cf5["visit()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| bd2e8909_e461_841f_0d61_4a0d1fd86cf5
  8f599c78_9d07_c6af_753a_52bf67a83b30["file_type()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 8f599c78_9d07_c6af_753a_52bf67a83b30
  22e554e0_3279_5bba_cd5c_45aa591685d1["path()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 22e554e0_3279_5bba_cd5c_45aa591685d1
  4e11484a_f38c_8d3f_e342_f6603e2f6952["is_dir()"]
  83e9692c_0ef1_97e5_4b56_90182cf80c7a -->|calls| 4e11484a_f38c_8d3f_e342_f6603e2f6952
  style 83e9692c_0ef1_97e5_4b56_90182cf80c7a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/walk.rs lines 1715–1785

    fn generate_work(
        &mut self,
        ig: &Ignore,
        depth: usize,
        root_device: Option<u64>,
        result: Result<fs::DirEntry, io::Error>,
    ) -> WalkState {
        let fs_dent = match result {
            Ok(fs_dent) => fs_dent,
            Err(err) => {
                return self.visitor.visit(Err(Error::from(err).with_depth(depth)));
            }
        };
        let mut dent = match DirEntryRaw::from_entry(depth, &fs_dent) {
            Ok(dent) => DirEntry::new_raw(dent, None),
            Err(err) => {
                return self.visitor.visit(Err(err));
            }
        };
        let is_symlink = dent.file_type().map_or(false, |ft| ft.is_symlink());
        if self.follow_links && is_symlink {
            let path = dent.path().to_path_buf();
            dent = match DirEntryRaw::from_path(depth, path, true) {
                Ok(dent) => DirEntry::new_raw(dent, None),
                Err(err) => {
                    return self.visitor.visit(Err(err));
                }
            };
            if dent.is_dir() {
                if let Err(err) = check_symlink_loop(ig, dent.path(), depth) {
                    return self.visitor.visit(Err(err));
                }
            }
        }
        // N.B. See analogous call in the single-threaded implementation about
        // why it's important for this to come before the checks below.
        if should_skip_entry(ig, &dent) {
            return WalkState::Continue;
        }
        if let Some(ref stdout) = self.skip {
            let is_stdout = match path_equals(&dent, stdout) {
                Ok(is_stdout) => is_stdout,
                Err(err) => return self.visitor.visit(Err(err)),
            };
            if is_stdout {
                return WalkState::Continue;
            }
        }
        let should_skip_filesize = if self.max_filesize.is_some() && !dent.is_dir() {
            skip_filesize(
                self.max_filesize.unwrap(),
                dent.path(),
                &dent.metadata().ok(),
            )
        } else {
            false
        };
        let should_skip_filtered = if let Some(Filter(predicate)) = &self.filter {
            !predicate(&dent)
        } else {
            false
        };
        if !should_skip_filesize && !should_skip_filtered {
            self.send(Work {
                dent,
                ignore: ig.clone(),
                root_device,
            });
        }
        WalkState::Continue
    }

Subdomains

Called By

Frequently Asked Questions

What does generate_work() do?
generate_work() is a function in the tailwindcss codebase.
What does generate_work() call?
generate_work() calls 14 function(s): check_symlink_loop, file_type, from_entry, from_path, is_dir, is_symlink, metadata, new_raw, and 6 more.
What calls generate_work()?
generate_work() is called by 1 function(s): run_one.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free