sass_embedded/
lib.rs

1//! A Rust library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
2//!
3//! ```no_run
4//! use sass_embedded::{Sass, StringOptions};
5//!
6//! let mut sass = Sass::new("path/to/sass_embedded").unwrap();
7//! let res = sass.compile_string("a {b: c}", StringOptions::default()).unwrap();
8//! println!("{:?}", res);
9//! ```
10//!
11//! # features
12//!
13//! - **`legacy`**: support for [sass's legacy APIs](https://sass-lang.com/documentation/js-api/modules#renderSync)
14//!
15
16#![forbid(unsafe_code)]
17#![deny(missing_docs)]
18
19mod api;
20mod channel;
21mod compiler;
22mod connection;
23mod dispatcher;
24mod embedded;
25mod error;
26mod host;
27mod protocol;
28mod varint;
29
30#[cfg(feature = "legacy")]
31pub mod legacy;
32
33pub use api::{
34  BoxFileImporter, BoxImporter, BoxLogger, CompileResult, FileImporter,
35  Importer, ImporterOptions, ImporterResult, Logger, LoggerDebugOptions,
36  LoggerWarnOptions, Options, OptionsBuilder, OutputStyle, SassImporter,
37  SourceSpan, StringOptions, StringOptionsBuilder, Syntax,
38};
39pub use embedded::{Embedded, Embedded as Sass};
40pub use error::{Exception, Result};
41pub use url::{self, Url};
42
43/// A Logger that silently ignores all warnings and debug messages.
44///
45/// More information: [Sass documentation][https://sass-lang.com/documentation/js-api/modules/Logger#silent]
46#[derive(Debug, Default, Clone)]
47pub struct Silent;
48
49impl Logger for Silent {
50  fn debug(&self, _: &str, _: &LoggerDebugOptions) {}
51
52  fn warn(&self, _: &str, _: &LoggerWarnOptions) {}
53}