pub struct CodeBlock<'a> { /* private fields */ }Expand description
Syntax-highlighted code block builder. Auto-renders on Drop.
Constructed via Context::code_block. Chain .lang(...) for
language-aware highlighting and .numbered() for a line-number gutter.
Drop the value to render without capturing a response, or call
Self::show to render and obtain a Response.
Consuming-builder shape, mirroring Gauge /
Breadcrumb: Drop is intentional so ui.code_block(code); is the
idiomatic form when the response isn’t needed (egui’s ui.add(...) idiom).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CodeBlock<'a>
impl<'a> !RefUnwindSafe for CodeBlock<'a>
impl<'a> !Send for CodeBlock<'a>
impl<'a> !Sync for CodeBlock<'a>
impl<'a> Unpin for CodeBlock<'a>
impl<'a> UnsafeUnpin for CodeBlock<'a>
impl<'a> !UnwindSafe for CodeBlock<'a>
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