extract() — tailwindcss Function Reference
Architecture documentation for the extract() function in mod.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 8b98e622_fb07_ab68_6ea9_cff96fc37db6["extract()"] c6b9ad01_bfbd_d4a3_0543_b60d5f83e5d7["get_candidates_with_positions()"] c6b9ad01_bfbd_d4a3_0543_b60d5f83e5d7 -->|calls| 8b98e622_fb07_ab68_6ea9_cff96fc37db6 13c697bf_449d_2ac5_439a_211d8945d721["extract_css_variables()"] 13c697bf_449d_2ac5_439a_211d8945d721 -->|calls| 8b98e622_fb07_ab68_6ea9_cff96fc37db6 e61e4bec_63c8_a3d9_0f83_d9ddcc055c47["parse_all_blobs()"] e61e4bec_63c8_a3d9_0f83_d9ddcc055c47 -->|calls| 8b98e622_fb07_ab68_6ea9_cff96fc37db6 style 8b98e622_fb07_ab68_6ea9_cff96fc37db6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/oxide/src/scanner/mod.rs lines 527–564
fn extract<H>(blobs: Vec<Vec<u8>>, handle: H) -> Vec<String>
where
H: Fn(Extractor) -> Vec<Extracted> + std::marker::Sync,
{
let mut result: Vec<_> = blobs
.par_iter()
.flat_map(|blob| blob.par_split(|x| *x == b'\n'))
.filter_map(|blob| {
if blob.is_empty() {
return None;
}
let extracted = handle(crate::extractor::Extractor::new(blob));
if extracted.is_empty() {
return None;
}
Some(FxHashSet::from_iter(extracted.into_iter().map(
|x| match x {
Extracted::Candidate(bytes) => bytes,
Extracted::CssVariable(bytes) => bytes,
},
)))
})
.reduce(Default::default, |mut a, b| {
a.extend(b);
a
})
.into_iter()
.map(|s| unsafe { String::from_utf8_unchecked(s.to_vec()) })
.collect();
// SAFETY: Unstable sort is faster and in this scenario it's also safe because we are
// guaranteed to have unique candidates.
result.par_sort_unstable();
result
}
Domain
Subdomains
Source
Frequently Asked Questions
What does extract() do?
extract() is a function in the tailwindcss codebase.
What calls extract()?
extract() is called by 3 function(s): extract_css_variables, get_candidates_with_positions, parse_all_blobs.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free