Home / File/ dir.rs — tailwindcss Source File

dir.rs — tailwindcss Source File

Architecture documentation for dir.rs, a rust file in the tailwindcss codebase. 2 imports, 0 dependents.

File rust Oxide PreProcessors 2 imports 55 functions

Entity Profile

Dependency Diagram

graph LR
  a558c8e1_3e7c_59d2_b113_bacec65ba188["dir.rs"]
  cf006a3e_51d2_5361_1dd4_6d904d0bfa75["std::"]
  a558c8e1_3e7c_59d2_b113_bacec65ba188 --> cf006a3e_51d2_5361_1dd4_6d904d0bfa75
  81ece9c1_054c_504a_d7a0_4d0590ba157c["crate::"]
  a558c8e1_3e7c_59d2_b113_bacec65ba188 --> 81ece9c1_054c_504a_d7a0_4d0590ba157c
  style a558c8e1_3e7c_59d2_b113_bacec65ba188 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// This module provides a data structure, `Ignore`, that connects "directory
// traversal" with "ignore matchers." Specifically, it knows about gitignore
// semantics and precedence, and is organized based on directory hierarchy.
// Namely, every matcher logically corresponds to ignore rules from a single
// directory, and points to the matcher for its corresponding parent directory.
// In this sense, `Ignore` is a *persistent* data structure.
//
// This design was specifically chosen to make it possible to use this data
// structure in a parallel directory iterator.
//
// My initial intention was to expose this module as part of this crate's
// public API, but I think the data structure's public API is too complicated
// with non-obvious failure modes. Alas, such things haven't been documented
// well.

use std::{
    collections::HashMap,
    ffi::{OsStr, OsString},
    fs::{File, FileType},
    io::{self, BufRead},
    path::{Path, PathBuf},
    sync::{Arc, RwLock, Weak},
};

use crate::{
    gitignore::{self, Gitignore, GitignoreBuilder},
    overrides::{self, Override},
    pathutil::{is_hidden, strip_prefix},
    types::{self, Types},
    walk::DirEntry,
    {Error, Match, PartialErrorBuilder},
};

/// IgnoreMatch represents information about where a match came from when using
/// the `Ignore` matcher.
#[derive(Clone, Debug)]
#[allow(dead_code)]
pub(crate) struct IgnoreMatch<'a>(IgnoreMatchInner<'a>);

/// IgnoreMatchInner describes precisely where the match information came from.
/// This is private to allow expansion to more matchers in the future.
#[derive(Clone, Debug)]
#[allow(dead_code)]
enum IgnoreMatchInner<'a> {
    Override(overrides::Glob<'a>),
    Gitignore(&'a gitignore::Glob),
    Types(types::Glob<'a>),
    Hidden,
}

impl<'a> IgnoreMatch<'a> {
    fn overrides(x: overrides::Glob<'a>) -> IgnoreMatch<'a> {
        IgnoreMatch(IgnoreMatchInner::Override(x))
    }

    fn gitignore(x: &'a gitignore::Glob) -> IgnoreMatch<'a> {
        IgnoreMatch(IgnoreMatchInner::Gitignore(x))
    }

    fn types(x: types::Glob<'a>) -> IgnoreMatch<'a> {
// ... (1210 more lines)

Domain

Subdomains

Dependencies

  • crate::
  • std::

Frequently Asked Questions

What does dir.rs do?
dir.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the Oxide domain, PreProcessors subdomain.
What functions are defined in dir.rs?
dir.rs defines 55 function(s): absolute_base, absolute_parent, absolute_parent_anchored, add_child, add_child_path, add_custom_ignore_filename, add_ignore, add_parents, build, build_with_cwd, and 45 more.
What does dir.rs depend on?
dir.rs imports 2 module(s): crate::, std::.
Where is dir.rs in the architecture?
dir.rs is located at crates/ignore/src/dir.rs (domain: Oxide, subdomain: PreProcessors, directory: crates/ignore/src).

Analyze Your Own Codebase

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

Try Supermodel Free