pub struct EvalContext {
pub base_width: Option<Length>,
pub base_height: Option<Length>,
pub font_size: Length,
}Expand description
Context for evaluating expressions
Provides base values needed to resolve percentages and other context-dependent expressions.
Fields§
§base_width: Option<Length>Base width for percentage resolution
base_height: Option<Length>Base height for percentage resolution
font_size: LengthCurrent font size
Implementations§
Source§impl EvalContext
impl EvalContext
Sourcepub const fn new(
base_width: Option<Length>,
base_height: Option<Length>,
font_size: Length,
) -> Self
pub const fn new( base_width: Option<Length>, base_height: Option<Length>, font_size: Length, ) -> Self
Create a new evaluation context
Sourcepub const fn with_width(base_width: Length, font_size: Length) -> Self
pub const fn with_width(base_width: Length, font_size: Length) -> Self
Create a context with only width
Sourcepub const fn with_height(base_height: Length, font_size: Length) -> Self
pub const fn with_height(base_height: Length, font_size: Length) -> Self
Create a context with only height
Trait Implementations§
Source§impl Clone for EvalContext
impl Clone for EvalContext
Source§fn clone(&self) -> EvalContext
fn clone(&self) -> EvalContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EvalContext
impl Debug for EvalContext
impl Copy for EvalContext
Auto Trait Implementations§
impl Freeze for EvalContext
impl RefUnwindSafe for EvalContext
impl Send for EvalContext
impl Sync for EvalContext
impl Unpin for EvalContext
impl UnsafeUnpin for EvalContext
impl UnwindSafe for EvalContext
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