1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! A Rust library that will communicate with Embedded Dart Sass using the Embedded Sass protocol
//!
//! ```no_run
//! 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();
//! println!("{:?}", res);
//! ```
//!
//! # features
//!
//! - **`legacy`**: support for [sass's legacy APIs](https://sass-lang.com/documentation/js-api/modules#renderSync)
//!

#![forbid(unsafe_code)]
#![deny(missing_docs)]

mod api;
mod channel;
mod compiler;
mod connection;
mod dispatcher;
mod embedded;
mod error;
mod host;
mod protocol;
mod varint;

#[cfg(feature = "legacy")]
pub mod legacy;

pub use api::{
  BoxFileImporter, BoxImporter, BoxLogger, CompileResult, FileImporter,
  Importer, ImporterOptions, ImporterResult, Logger, LoggerDebugOptions,
  LoggerWarnOptions, Options, OptionsBuilder, OutputStyle, SassImporter,
  SourceSpan, StringOptions, StringOptionsBuilder, Syntax,
};
pub use embedded::{Embedded, Embedded as Sass};
pub use error::{Exception, Result};
pub use url::{self, Url};

/// A Logger that silently ignores all warnings and debug messages.
///
/// More information: [Sass documentation][https://sass-lang.com/documentation/js-api/modules/Logger#silent]
#[derive(Debug, Default, Clone)]
pub struct Silent;

impl Logger for Silent {
  fn debug(&self, _: &str, _: &LoggerDebugOptions) {}

  fn warn(&self, _: &str, _: &LoggerWarnOptions) {}
}