Skip to main content

compile

Function compile 

Source
pub fn compile(source: &str, options: &Options<'_>) -> Result<String, Error>
Expand description

Compile SCSS source to CSS.

§Errors

Returns Error on a parse or evaluation failure (with a 1-based source position when known).

§Allocator scope

When the binary installs ScopedAlloc as its #[global_allocator], this function brackets the whole compile in a bump-arena scope: every allocation compile_inner makes is a pointer bump from a per-thread arena that is freed wholesale when the scope ends. The returned Result is allocated in the arena, so it is deep-cloned out to the system allocator before the arena is reset — the value handed back to the caller never points into the arena. When no ScopedAlloc is installed the scope primitives are inert (depth tracking only) and every allocation goes to the system allocator as usual, so this wrapper is correct (just with a redundant clone) under any global allocator.