Home / File/ types.rs — tailwindcss Source File

types.rs — tailwindcss Source File

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

File rust Oxide Extractor 3 imports 22 functions

Entity Profile

Dependency Diagram

graph LR
  d51c6497_c250_cc24_5922_420f8b0354f8["types.rs"]
  7c00fec2_1c08_6c5b_16a0_455d169ae680["super::TypesBuilder"]
  d51c6497_c250_cc24_5922_420f8b0354f8 --> 7c00fec2_1c08_6c5b_16a0_455d169ae680
  cf006a3e_51d2_5361_1dd4_6d904d0bfa75["std::"]
  d51c6497_c250_cc24_5922_420f8b0354f8 --> cf006a3e_51d2_5361_1dd4_6d904d0bfa75
  81ece9c1_054c_504a_d7a0_4d0590ba157c["crate::"]
  d51c6497_c250_cc24_5922_420f8b0354f8 --> 81ece9c1_054c_504a_d7a0_4d0590ba157c
  style d51c6497_c250_cc24_5922_420f8b0354f8 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

Dependencies

  • crate::
  • std::
  • super::TypesBuilder

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 Oxide domain, Extractor 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: Oxide, subdomain: Extractor, directory: crates/ignore/src).

Analyze Your Own Codebase

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

Try Supermodel Free