pub struct BoxSpec {
pub content_alignment: Alignment,
pub propagate_min_constraints: bool,
}Expand description
Specification for Box layout behavior.
Fields§
§content_alignment: AlignmentWhere children sit inside the box. Defaults to top start.
propagate_min_constraints: boolWhether the box’s minimum constraints pass on to its children. Defaults to false.
Implementations§
Source§impl BoxSpec
impl BoxSpec
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a spec with top start alignment and no minimum constraint propagation.
Sourcepub fn content_alignment(self, alignment: Alignment) -> Self
pub fn content_alignment(self, alignment: Alignment) -> Self
Sets where children sit inside the box.
Sourcepub fn propagate_min_constraints(self, propagate: bool) -> Self
pub fn propagate_min_constraints(self, propagate: bool) -> Self
Sets whether the box’s minimum constraints pass on to its children.
Trait Implementations§
impl Copy for BoxSpec
impl StructuralPartialEq for BoxSpec
Auto Trait Implementations§
impl Freeze for BoxSpec
impl RefUnwindSafe for BoxSpec
impl Send for BoxSpec
impl Sync for BoxSpec
impl Unpin for BoxSpec
impl UnsafeUnpin for BoxSpec
impl UnwindSafe for BoxSpec
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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