pub struct Embedded { /* private fields */ }
Expand description
The sass-embedded compiler for rust host.
Implementations§
Source§impl 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
Source§impl 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 Freeze for Embedded
impl !RefUnwindSafe for Embedded
impl Send for Embedded
impl Sync for Embedded
impl Unpin for Embedded
impl !UnwindSafe for Embedded
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more