pub struct LayoutContext {
pub terminal_width: u16,
pub content_width: u16,
}Expand description
Layout context(§21)。
Sprint 1では幅情報のみを保持する。§21の theme / capabilities は
§101の依存方向(layout → terminal 禁止)と両立しないため、
必要になった時点で設計を改訂したうえで導入する。
Fields§
§terminal_width: u16§content_width: u16Implementations§
Source§impl LayoutContext
impl LayoutContext
Sourcepub fn from_options(options: &LayoutOptions) -> Self
pub fn from_options(options: &LayoutOptions) -> Self
content_width = min(terminal_width - margin * 2, max_width)(§21)。
Trait Implementations§
Source§impl Clone for LayoutContext
impl Clone for LayoutContext
Source§fn clone(&self) -> LayoutContext
fn clone(&self) -> LayoutContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LayoutContext
Source§impl Debug for LayoutContext
impl Debug for LayoutContext
impl Eq for LayoutContext
Source§impl PartialEq for LayoutContext
impl PartialEq for LayoutContext
impl StructuralPartialEq for LayoutContext
Auto Trait Implementations§
impl Freeze for LayoutContext
impl RefUnwindSafe for LayoutContext
impl Send for LayoutContext
impl Sync for LayoutContext
impl Unpin for LayoutContext
impl UnsafeUnpin for LayoutContext
impl UnwindSafe for LayoutContext
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