Home / Function/ new() — tailwindcss Function Reference

new() — tailwindcss Function Reference

Architecture documentation for the new() function in lib.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  62e2d7b0_c005_6cde_b001_32ac73e0fcef["new()"]
  45d3637d_63b6_933b_072c_47e0aeaa39a0["lib.rs"]
  62e2d7b0_c005_6cde_b001_32ac73e0fcef -->|defined in| 45d3637d_63b6_933b_072c_47e0aeaa39a0
  style 62e2d7b0_c005_6cde_b001_32ac73e0fcef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/src/lib.rs lines 535–553

        pub fn new() -> Result<TempDir> {
            use std::sync::atomic::{AtomicUsize, Ordering};

            static TRIES: usize = 100;
            static COUNTER: AtomicUsize = AtomicUsize::new(0);

            let tmpdir = env::temp_dir();
            for _ in 0..TRIES {
                let count = COUNTER.fetch_add(1, Ordering::Relaxed);
                let path = tmpdir.join("rust-ignore").join(count.to_string());
                if path.is_dir() {
                    continue;
                }
                fs::create_dir_all(&path)
                    .map_err(|e| err!("failed to create {}: {}", path.display(), e))?;
                return Ok(TempDir(path));
            }
            Err(err!("failed to create temp dir after {} tries", TRIES))
        }

Domain

Subdomains

Frequently Asked Questions

What does new() do?
new() is a function in the tailwindcss codebase, defined in crates/ignore/src/lib.rs.
Where is new() defined?
new() is defined in crates/ignore/src/lib.rs at line 535.

Analyze Your Own Codebase

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

Try Supermodel Free