Home / File/ boundary.rs — tailwindcss Source File

boundary.rs — tailwindcss Source File

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

File rust OxideEngine Extractor 2 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  370453f5_1434_7418_2789_1ad9e6e3d54e["boundary.rs"]
  5731c53a_0325_b3af_2918_bcb379bc8ec6["classification_macros::ClassifyBytes"]
  370453f5_1434_7418_2789_1ad9e6e3d54e --> 5731c53a_0325_b3af_2918_bcb379bc8ec6
  b0be0e22_d5d3_57db_4ed0_a45699e2a447["crate::extractor::Span"]
  370453f5_1434_7418_2789_1ad9e6e3d54e --> b0be0e22_d5d3_57db_4ed0_a45699e2a447
  style 370453f5_1434_7418_2789_1ad9e6e3d54e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

use classification_macros::ClassifyBytes;

use crate::extractor::Span;

#[inline(always)]
pub fn is_valid_before_boundary(c: &u8) -> bool {
    matches!(c.into(), Class::Common | Class::Before)
}

#[inline(always)]
pub fn is_valid_after_boundary(c: &u8) -> bool {
    matches!(c.into(), Class::Common | Class::After)
}

#[inline(always)]
pub fn has_valid_boundaries(span: &Span, input: &[u8]) -> bool {
    let before = {
        if span.start == 0 {
            b'\0'
        } else {
            input[span.start - 1]
        }
    };

    let after = {
        if span.end >= input.len() - 1 {
            b'\0'
        } else {
            input[span.end + 1]
        }
    };

    // Ensure the span has valid boundary characters before and after
    is_valid_before_boundary(&before) && is_valid_after_boundary(&after)
}

#[derive(Debug, Clone, Copy, ClassifyBytes)]
enum Class {
    // Whitespace, e.g.:
    //
    // ```
    // <div class="flex flex-col items-center"></div>
    //                 ^        ^
    // ```
    #[bytes(b'\t', b'\n', b'\x0C', b'\r', b' ')]
    // Quotes, e.g.:
    //
    // ```
    // <div class="flex">
    //            ^    ^
    // ```
    #[bytes(b'"', b'\'', b'`')]
    // End of the input, e.g.:
    //
    // ```
    // flex
    //     ^
    // ```
    #[bytes(b'\0')]
    Common,
// ... (69 more lines)

Domain

Subdomains

Dependencies

  • classification_macros::ClassifyBytes
  • crate::extractor::Span

Frequently Asked Questions

What does boundary.rs do?
boundary.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the OxideEngine domain, Extractor subdomain.
What functions are defined in boundary.rs?
boundary.rs defines 3 function(s): has_valid_boundaries, is_valid_after_boundary, is_valid_before_boundary.
What does boundary.rs depend on?
boundary.rs imports 2 module(s): classification_macros::ClassifyBytes, crate::extractor::Span.
Where is boundary.rs in the architecture?
boundary.rs is located at crates/oxide/src/extractor/boundary.rs (domain: OxideEngine, subdomain: Extractor, directory: crates/oxide/src/extractor).

Analyze Your Own Codebase

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

Try Supermodel Free