types.rs — tailwindcss Source File
Architecture documentation for types.rs, a rust file in the tailwindcss codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 08edba3a_006b_c0f4_caba_f2d75c8302a3["types.rs"] a3a7eee3_4fad_798f_c671_002466ff4490["super::TypesBuilder"] 08edba3a_006b_c0f4_caba_f2d75c8302a3 --> a3a7eee3_4fad_798f_c671_002466ff4490 148a0379_62c6_86e3_d9b3_de1fdebd7cfb["std::"] 08edba3a_006b_c0f4_caba_f2d75c8302a3 --> 148a0379_62c6_86e3_d9b3_de1fdebd7cfb 9cbe6468_bd8d_8529_1ea5_0e68c0d2850e["crate::"] 08edba3a_006b_c0f4_caba_f2d75c8302a3 --> 9cbe6468_bd8d_8529_1ea5_0e68c0d2850e style 08edba3a_006b_c0f4_caba_f2d75c8302a3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/*!
The types module provides a way of associating globs on file names to file
types.
This can be used to match specific types of files. For example, among
the default file types provided, the Rust file type is defined to be `*.rs`
with name `rust`. Similarly, the C file type is defined to be `*.{c,h}` with
name `c`.
Note that the set of default types may change over time.
# Example
This shows how to create and use a simple file type matcher using the default
file types defined in this crate.
```
use ignore::types::TypesBuilder;
let mut builder = TypesBuilder::new();
builder.add_defaults();
builder.select("rust");
let matcher = builder.build().unwrap();
assert!(matcher.matched("foo.rs", false).is_whitelist());
assert!(matcher.matched("foo.c", false).is_ignore());
```
# Example: negation
This is like the previous example, but shows how negating a file type works.
That is, this will let us match file paths that *don't* correspond to a
particular file type.
```
use ignore::types::TypesBuilder;
let mut builder = TypesBuilder::new();
builder.add_defaults();
builder.negate("c");
let matcher = builder.build().unwrap();
assert!(matcher.matched("foo.rs", false).is_none());
assert!(matcher.matched("foo.c", false).is_ignore());
```
# Example: custom file type definitions
This shows how to extend this library default file type definitions with
your own.
```
use ignore::types::TypesBuilder;
let mut builder = TypesBuilder::new();
builder.add_defaults();
builder.add("foo", "*.foo");
// Another way of adding a file type definition.
// This is useful when accepting input from an end user.
builder.add_def("bar:*.bar");
// ... (542 more lines)
Domain
Subdomains
Functions
Dependencies
- crate::
- std::
- super::TypesBuilder
Source
Frequently Asked Questions
What does types.rs do?
types.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the OxideEngine domain, PreProcessors subdomain.
What functions are defined in types.rs?
types.rs defines 22 function(s): add, add_def, add_defaults, build, clear, definitions, empty, file_type_def, globs, inner, and 12 more.
What does types.rs depend on?
types.rs imports 3 module(s): crate::, std::, super::TypesBuilder.
Where is types.rs in the architecture?
types.rs is located at crates/ignore/src/types.rs (domain: OxideEngine, 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