pub struct Engine {
pub diagnostics: Vec<String>,
/* private fields */
}Fields§
§diagnostics: Vec<String>Implementations§
Source§impl Engine
impl Engine
pub fn compile(css: &str) -> Engine
pub fn compile_sheets(sheets: &[&str]) -> Engine
pub fn uses_sibling_combinators(&self) -> bool
pub fn classes_keyed_on_the_parent(&self) -> impl Iterator<Item = &str>
pub fn uses_group_states(&self) -> bool
Sourcepub fn uses_containers(&self) -> bool
pub fn uses_containers(&self) -> bool
Whether a style can depend on a query container: the sheet has @container or a cq*
unit. Inline styles with a cq* unit are the caller’s to notice.
Sourcepub fn keyframes(&self, name: &str, env: &Env) -> Option<Rc<Keyframes>>
pub fn keyframes(&self, name: &str, env: &Env) -> Option<Rc<Keyframes>>
The last block of that name whose condition holds in env (CSS duplicate-name rule). Rc
because a running animation keeps the block it started with.
pub fn keyframes_for( &self, name: &str, vars: &Vars, env: &Env, diagnostics: &mut Vec<String>, ) -> Option<Rc<Keyframes>>
Sourcepub fn with_functions<R>(&self, f: impl FnOnce() -> R) -> R
pub fn with_functions<R>(&self, f: impl FnOnce() -> R) -> R
Runs f with this sheet’s @functions callable, for values compiled outside the cascade.
pub fn has_keyframes(&self) -> bool
pub fn rebase_viewport(&mut self) -> bool
pub fn compute<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, env: &Env, ) -> ComputedStates
pub fn compute_with<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, inline_transitions: Option<&Rc<Vec<TransitionSpec>>>, env: &Env, ) -> ComputedStates
pub fn compute_full<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, inline_transitions: Option<&Rc<Vec<TransitionSpec>>>, inline_extras: Extras, env: &Env, ) -> ComputedStates
Sourcepub fn compute_node<D: MatchDom>(
&self,
node: D,
inline: Option<&InlineStyle>,
parent_vars: &Rc<Vars>,
parent_color: Option<Hsla>,
env: &Env,
diagnostics: &mut Vec<String>,
) -> ComputedStates
pub fn compute_node<D: MatchDom>( &self, node: D, inline: Option<&InlineStyle>, parent_vars: &Rc<Vars>, parent_color: Option<Hsla>, env: &Env, diagnostics: &mut Vec<String>, ) -> ComputedStates
Custom properties inherit, so the caller must walk the tree in document order and thread
each node’s vars into its children. diagnostics are per element; the caller dedupes.
pub fn compute_node_at<D: MatchDom>( &self, node: D, inline: Option<&InlineStyle>, parent_vars: &Rc<Vars>, parent_color: Option<Hsla>, parent_font_size: f32, env: &Env, diagnostics: &mut Vec<String>, ) -> ComputedStates
pub fn compute_node_with_font<D: MatchDom>( &self, node: D, inline: Option<&InlineStyle>, parent_vars: &Rc<Vars>, parent_color: Option<Hsla>, parent_font_size: f32, parent_font: &Font, env: &Env, diagnostics: &mut Vec<String>, ) -> ComputedStates
Source§impl Engine
impl Engine
pub fn matched_rules<D: MatchDom>(&self, node: D, env: &Env) -> Vec<MatchedRule>
Auto Trait Implementations§
impl !RefUnwindSafe for Engine
impl !Send for Engine
impl !Sync for Engine
impl !UnwindSafe for Engine
impl Forget for Engine
impl Freeze for Engine
impl Move for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more