dir.rs — tailwindcss Source File
Architecture documentation for dir.rs, a rust file in the tailwindcss codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 510a4ebc_9a2a_672a_2d6d_a56dabd1134b["dir.rs"] 148a0379_62c6_86e3_d9b3_de1fdebd7cfb["std::"] 510a4ebc_9a2a_672a_2d6d_a56dabd1134b --> 148a0379_62c6_86e3_d9b3_de1fdebd7cfb 9cbe6468_bd8d_8529_1ea5_0e68c0d2850e["crate::"] 510a4ebc_9a2a_672a_2d6d_a56dabd1134b --> 9cbe6468_bd8d_8529_1ea5_0e68c0d2850e style 510a4ebc_9a2a_672a_2d6d_a56dabd1134b 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
Functions
- absolute_base()
- absolute_parent()
- absolute_parent_anchored()
- add_child()
- add_child_path()
- add_custom_ignore_filename()
- add_ignore()
- add_parents()
- build()
- build_with_cwd()
- create_gitignore()
- current_dir()
- custom_ignore()
- custom_ignore_over_ignore()
- custom_ignore_precedence()
- errored()
- errored_both()
- errored_partial()
- errored_partial_and_ignore()
- exclude_lowest()
- explicit_ignore()
- git_exclude()
- git_global()
- git_ignore()
- git_info_exclude_in_linked_worktree()
- gitignore()
- gitignore_allowed_no_git()
- gitignore_no_git()
- gitignore_with_jj()
- has_any_ignore_rules()
- hidden()
- ignore()
- ignore_case_insensitive()
- ignore_over_gitignore()
- is_absolute_parent()
- is_root()
- matched()
- matched_dir_entry()
- matched_ignore()
- mkdirp()
- new()
- next()
- not_present_empty()
- overrides()
- parent()
- parents()
- partial()
- path()
- require_git()
- resolve_git_commondir()
- stops_at_git_dir()
- strip_if_is_prefix()
- tmpdir()
- types()
- wfile()
Dependencies
- crate::
- std::
Source
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 OxideEngine domain, Scanner 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: OxideEngine, subdomain: Scanner, directory: crates/ignore/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free