pub struct FramePart {
pub frame: Frame,
pub width: u16,
}Expand description
A horizontally-stacked slot in Frame::hstack.
Each part holds a child frame and the width it occupies in the composed
output. Use FramePart::fit / FramePart::wrap / FramePart::truncate
to construct a slot from an unrestricted child frame — they fit the inner
frame to width for you. Use FramePart::new only when the caller has
already guaranteed the frame fits the slot (e.g., a separator column built
at exactly the right width).
Fields§
§frame: Frame§width: u16Implementations§
Source§impl FramePart
impl FramePart
Sourcepub fn new(frame: Frame, width: u16) -> Self
pub fn new(frame: Frame, width: u16) -> Self
Construct a slot from an already-fitted frame. Caller is responsible
for ensuring frame does not exceed width. Prefer fit / wrap /
truncate for unrestricted children.
Sourcepub fn fit(frame: Frame, width: u16, options: FitOptions) -> Self
pub fn fit(frame: Frame, width: u16, options: FitOptions) -> Self
Fit frame to width with the given options before adopting it as a
slot. This is the right constructor for slots built from arbitrary
child output.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FramePart
impl RefUnwindSafe for FramePart
impl Send for FramePart
impl Sync for FramePart
impl Unpin for FramePart
impl UnsafeUnpin for FramePart
impl UnwindSafe for FramePart
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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