extract() — tailwindcss Function Reference
Architecture documentation for the extract() function in mod.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD e3c5d51c_7520_d380_3d8e_291bfd72cc41["extract()"] 99d2dd55_e7d6_72e7_f911_7a13f8c522f7["get_candidates_with_positions()"] 99d2dd55_e7d6_72e7_f911_7a13f8c522f7 -->|calls| e3c5d51c_7520_d380_3d8e_291bfd72cc41 cb0c721d_b70b_57c6_844b_1eb37f21c732["extract_css_variables()"] cb0c721d_b70b_57c6_844b_1eb37f21c732 -->|calls| e3c5d51c_7520_d380_3d8e_291bfd72cc41 4571d4dc_ca99_fe60_d6a3_7f055dd490f1["parse_all_blobs()"] 4571d4dc_ca99_fe60_d6a3_7f055dd490f1 -->|calls| e3c5d51c_7520_d380_3d8e_291bfd72cc41 style e3c5d51c_7520_d380_3d8e_291bfd72cc41 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