Skip to main content

Engine

Struct Engine 

Source
pub struct Engine {
    pub diagnostics: Vec<String>,
    /* private fields */
}

Fields§

§diagnostics: Vec<String>

Implementations§

Source§

impl Engine

Source

pub fn compile(css: &str) -> Engine

Source

pub fn compile_sheets(sheets: &[&str]) -> Engine

Source

pub fn uses_sibling_combinators(&self) -> bool

Source

pub fn classes_keyed_on_the_parent(&self) -> impl Iterator<Item = &str>

Source

pub fn uses_group_states(&self) -> bool

Source

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.

Source

pub fn keyframes_for( &self, name: &str, vars: &Vars, env: &Env, diagnostics: &mut Vec<String>, ) -> Option<Rc<Keyframes>>

Source

pub fn has_keyframes(&self) -> bool

Source

pub fn rebase_viewport(&mut self) -> bool

Source

pub fn compute<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, env: &Env, ) -> ComputedStates

Source

pub fn compute_with<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, inline_transitions: Option<&Rc<Vec<TransitionSpec>>>, env: &Env, ) -> ComputedStates

Source

pub fn compute_full<D: MatchDom>( &self, node: D, inline: Option<&StyleRefinement>, inline_transitions: Option<&Rc<Vec<TransitionSpec>>>, inline_extras: Extras, env: &Env, ) -> ComputedStates

Source

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.

Source

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

Source

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

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more