pub struct BlockLayoutContext {
pub available_width: Length,
pub current_y: Length,
pub max_width: Length,
}Expand description
Block layout context
Fields§
§available_width: LengthAvailable width for blocks
current_y: LengthCurrent Y position
max_width: LengthMaximum width seen
Implementations§
Source§impl BlockLayoutContext
impl BlockLayoutContext
Sourcepub fn allocate(&mut self, width: Length, height: Length) -> Rect
pub fn allocate(&mut self, width: Length, height: Length) -> Rect
Allocate space for a block with optional space-before/space-after
Sourcepub fn allocate_with_spacing(
&mut self,
width: Length,
height: Length,
space_before: Length,
space_after: Length,
) -> Rect
pub fn allocate_with_spacing( &mut self, width: Length, height: Length, space_before: Length, space_after: Length, ) -> Rect
Allocate space with space-before and space-after
Sourcepub fn total_height(&self) -> Length
pub fn total_height(&self) -> Length
Get the total height allocated
Auto Trait Implementations§
impl Freeze for BlockLayoutContext
impl RefUnwindSafe for BlockLayoutContext
impl Send for BlockLayoutContext
impl Sync for BlockLayoutContext
impl Unpin for BlockLayoutContext
impl UnsafeUnpin for BlockLayoutContext
impl UnwindSafe for BlockLayoutContext
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> 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