Struct sass_embedded::Embedded
source · [−]pub struct Embedded { /* private fields */ }
Expand description
The sass-embedded compiler for rust host.
Implementations
sourceimpl Embedded
impl Embedded
sourcepub fn new(exe_path: impl AsRef<OsStr>) -> Result<Self>
pub fn new(exe_path: impl AsRef<OsStr>) -> Result<Self>
Creates a sass-embedded compiler and connects with the dart-sass-embedded.
let mut sass = sass_embedded::Sass::new("path/to/sass_embedded").unwrap();
sourcepub fn compile(
&mut self,
path: impl AsRef<Path>,
options: Options
) -> Result<CompileResult>
pub fn compile(
&mut self,
path: impl AsRef<Path>,
options: Options
) -> Result<CompileResult>
Compiles the Sass file at path to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an [Exception].
use sass_embedded::{Sass, Options};
let mut sass = Sass::new("path/to/sass_embedded").unwrap();
let res = sass.compile("../styles/a.scss", Options::default()).unwrap();
More information: Sass documentation
sourcepub fn compile_string(
&mut self,
source: impl Into<String>,
options: StringOptions
) -> Result<CompileResult>
pub fn compile_string(
&mut self,
source: impl Into<String>,
options: StringOptions
) -> Result<CompileResult>
Compiles a stylesheet whose contents is source to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an [Exception].
use sass_embedded::{Sass, StringOptions};
let mut sass = Sass::new("path/to/sass_embedded").unwrap();
let res = sass.compile_string("a {b: c}", StringOptions::default()).unwrap();
More information: Sass documentation
sourceimpl Embedded
impl Embedded
sourcepub fn render(&mut self, options: LegacyOptions) -> Result<LegacyResult>
pub fn render(&mut self, options: LegacyOptions) -> Result<LegacyResult>
More information: Sass documentation
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Embedded
impl Send for Embedded
impl Sync for Embedded
impl Unpin for Embedded
impl !UnwindSafe for Embedded
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more