pub struct LogicalBuilder { /* private fields */ }Expand description
SizeRules builder
Implementations§
Source§impl LogicalBuilder
impl LogicalBuilder
Sourcepub fn new(size: impl Into<LogicalSize>, scale_factor: f32) -> Self
pub fn new(size: impl Into<LogicalSize>, scale_factor: f32) -> Self
Construct from mandatory arguments: size and scale_factor
Sourcepub fn with_ideal_factor(self, factor: f32) -> Self
pub fn with_ideal_factor(self, factor: f32) -> Self
Set the ideal size factor
The minimum size is set directly from the input size. The ideal size is
set from the minimum multiplied by the ideal factor.
By default this is 1.0.
Sourcepub fn with_margin(self, margin: f32) -> Self
pub fn with_margin(self, margin: f32) -> Self
Set all margins (symmetric)
All margins are set to the same value. By default these are 0.0.
Sourcepub fn with_stretch(self, stretch: Stretch) -> Self
pub fn with_stretch(self, stretch: Stretch) -> Self
Set the stretch priority
By default this is Stretch::None.
Sourcepub fn build(self, axis: impl Directional) -> SizeRules
pub fn build(self, axis: impl Directional) -> SizeRules
Build SizeRules
Auto Trait Implementations§
impl Freeze for LogicalBuilder
impl RefUnwindSafe for LogicalBuilder
impl Send for LogicalBuilder
impl Sync for LogicalBuilder
impl Unpin for LogicalBuilder
impl UnwindSafe for LogicalBuilder
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.