[−][src]Struct kas::layout::SolveCache
Size solver
This struct is used to solve widget layout, read size constraints and cache the results until the next solver run.
SolveCache::find_constraints
constructs an instance of this struct,
solving for size constraints.
SolveCache::apply_rect
accepts a Rect
, updates constraints as
necessary and sets widget positions within this rect
.
Methods
impl SolveCache
[src]
pub fn min(&self, inner_margin: bool) -> Size
[src]
Get the minimum size
If inner_margin
is true, margins are included in the result.
pub fn ideal(&self, inner_margin: bool) -> Size
[src]
Get the ideal size
If inner_margin
is true, margins are included in the result.
pub fn margins(&self) -> Margins
[src]
Get the margins
pub fn find_constraints(
widget: &mut dyn WidgetConfig,
size_handle: &mut dyn SizeHandle
) -> Self
[src]
widget: &mut dyn WidgetConfig,
size_handle: &mut dyn SizeHandle
) -> Self
Calculate required size of widget
pub fn invalidate_rule_cache(&mut self)
[src]
Force updating of size rules
This should be called whenever widget size rules have been changed. It
forces SolveCache::apply_rect
to recompute these rules when next
called.
pub fn apply_rect(
&mut self,
widget: &mut dyn WidgetConfig,
size_handle: &mut dyn SizeHandle,
rect: Rect,
inner_margin: bool
)
[src]
&mut self,
widget: &mut dyn WidgetConfig,
size_handle: &mut dyn SizeHandle,
rect: Rect,
inner_margin: bool
)
Apply layout solution to a widget
The widget's layout is solved for the given rect
and assigned.
If inner_margin
is true, margins are internal to this rect
; if not,
the caller is responsible for handling margins.
If SolveCache::invalidate_rule_cache
was called since rules were
last calculated then this method will recalculate all rules; otherwise
it will only do so if necessary (when dimensions do not match those
last used).
Auto Trait Implementations
impl RefUnwindSafe for SolveCache
impl Send for SolveCache
impl Sync for SolveCache
impl Unpin for SolveCache
impl UnwindSafe for SolveCache
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
[src]
Scheme: ApproxScheme,
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
[src]
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
[src]
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, Dst> ConvAsUtil<Dst> for T
[src]
fn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
[src]
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
[src]
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
impl<T> ConvUtil for T
[src]
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
[src]
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
[src]
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
fn into_as<Dst>(self) -> Dst where
Self: Into<Dst>,
[src]
Self: Into<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: TryInto<Dst>,
[src]
Self: TryInto<Dst>,
fn value_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ValueInto<Dst>,
[src]
Self: ValueInto<Dst>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src> TryFrom<Src> for Src
[src]
type Err = NoError
The error type produced by a failed conversion.
fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<Src, Dst> TryInto<Dst> for Src where
Dst: TryFrom<Src>,
[src]
Dst: TryFrom<Src>,
type Err = <Dst as TryFrom<Src>>::Err
The error type produced by a failed conversion.
fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Src> ValueFrom<Src> for Src
[src]
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
[src]
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
[src]
Dst: ValueFrom<Src>,