pathutil.rs — tailwindcss Source File
Architecture documentation for pathutil.rs, a rust file in the tailwindcss codebase. 7 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 5a63fc5c_8a1d_dad2_626b_d01b587f0205["pathutil.rs"] 148a0379_62c6_86e3_d9b3_de1fdebd7cfb["std::"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 148a0379_62c6_86e3_d9b3_de1fdebd7cfb 9c9102c3_14b2_8e2f_8d02_be2ed6f7f802["crate::walk::DirEntry"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 9c9102c3_14b2_8e2f_8d02_be2ed6f7f802 1ff93a68_c84c_5da0_7187_1217cd2fcaf2["std::os::unix::ffi::OsStrExt"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 1ff93a68_c84c_5da0_7187_1217cd2fcaf2 978002d0_6522_61c2_2f93_12c74ed1ba02["std::os::windows::fs::MetadataExt"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 978002d0_6522_61c2_2f93_12c74ed1ba02 fe6af308_23e3_465e_a570_c171cf299173["winapi_util::file"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> fe6af308_23e3_465e_a570_c171cf299173 75842db1_ba55_7449_4eef_60f707d11752["memchr::memchr"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 75842db1_ba55_7449_4eef_60f707d11752 6da38169_1c2a_60bc_f683_7e94cfe347d9["memchr::memrchr"] 5a63fc5c_8a1d_dad2_626b_d01b587f0205 --> 6da38169_1c2a_60bc_f683_7e94cfe347d9 style 5a63fc5c_8a1d_dad2_626b_d01b587f0205 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
use std::{ffi::OsStr, path::Path};
use crate::walk::DirEntry;
/// Returns true if and only if this entry is considered to be hidden.
///
/// This only returns true if the base name of the path starts with a `.`.
///
/// On Unix, this implements a more optimized check.
#[cfg(unix)]
pub(crate) fn is_hidden(dent: &DirEntry) -> bool {
use std::os::unix::ffi::OsStrExt;
if let Some(name) = file_name(dent.path()) {
name.as_bytes().get(0) == Some(&b'.')
} else {
false
}
}
/// Returns true if and only if this entry is considered to be hidden.
///
/// On Windows, this returns true if one of the following is true:
///
/// * The base name of the path starts with a `.`.
/// * The file attributes have the `HIDDEN` property set.
#[cfg(windows)]
pub(crate) fn is_hidden(dent: &DirEntry) -> bool {
use std::os::windows::fs::MetadataExt;
use winapi_util::file;
// This looks like we're doing an extra stat call, but on Windows, the
// directory traverser reuses the metadata retrieved from each directory
// entry and stores it on the DirEntry itself. So this is "free."
if let Ok(md) = dent.metadata() {
if file::is_hidden(md.file_attributes() as u64) {
return true;
}
}
if let Some(name) = file_name(dent.path()) {
name.to_str().map(|s| s.starts_with(".")).unwrap_or(false)
} else {
false
}
}
/// Returns true if and only if this entry is considered to be hidden.
///
/// This only returns true if the base name of the path starts with a `.`.
#[cfg(not(any(unix, windows)))]
pub(crate) fn is_hidden(dent: &DirEntry) -> bool {
if let Some(name) = file_name(dent.path()) {
name.to_str().map(|s| s.starts_with(".")).unwrap_or(false)
} else {
false
}
}
/// Strip `prefix` from the `path` and return the remainder.
///
// ... (82 more lines)
Domain
Subdomains
Dependencies
- crate::walk::DirEntry
- memchr::memchr
- memchr::memrchr
- std::
- std::os::unix::ffi::OsStrExt
- std::os::windows::fs::MetadataExt
- winapi_util::file
Source
Frequently Asked Questions
What does pathutil.rs do?
pathutil.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 pathutil.rs?
pathutil.rs defines 4 function(s): file_name, is_file_name, is_hidden, strip_prefix.
What does pathutil.rs depend on?
pathutil.rs imports 7 module(s): crate::walk::DirEntry, memchr::memchr, memchr::memrchr, std::, std::os::unix::ffi::OsStrExt, std::os::windows::fs::MetadataExt, winapi_util::file.
Where is pathutil.rs in the architecture?
pathutil.rs is located at crates/ignore/src/pathutil.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