pub struct CodeblockIntrinsic { /* private fields */ }Expand description
Intrinsic measurer for Codeblock.
Reuses compute_code_dimensions (same function as the painter) to derive:
width = max_line_width + gutter_width + pad_left + pad_rightheight = line_count × line_height + pad_top + pad_bottom + chrome_height
Computed once at construction from the initial code string. If a state
transition widens the content at paint time, auto_scroll handles vertical
overflow without needing the intrinsic to re-run.
Implementations§
Source§impl CodeblockIntrinsic
impl CodeblockIntrinsic
pub fn from_codeblock(c: &Codeblock) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeblockIntrinsic
impl RefUnwindSafe for CodeblockIntrinsic
impl Send for CodeblockIntrinsic
impl Sync for CodeblockIntrinsic
impl Unpin for CodeblockIntrinsic
impl UnsafeUnpin for CodeblockIntrinsic
impl UnwindSafe for CodeblockIntrinsic
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