pub struct Panel { /* private fields */ }Implementations§
Source§impl Panel
impl Panel
Sourcepub fn new(content: impl Into<String>) -> Self
pub fn new(content: impl Into<String>) -> Self
Examples found in repository?
examples/demo.rs (lines 296-300)
295fn print_panel_demo() {
296 let welcome_panel = Panel::new(
297 "Welcome to Pinax - a powerful terminal UI toolkit for Rust! \
298 This panel demonstrates text wrapping and border styling capabilities. \
299 Long text will automatically wrap to fit within the specified width.",
300 )
301 .with_title("Welcome")
302 .with_width(60);
303
304 let stats_panel = Panel::new(
305 "📈 Active Users: 1,234\n\
306 🔄 Server Uptime: 99.9%\n\
307 💾 Memory Usage: 2.1GB\n\
308 🚀 Response Time: 45ms",
309 )
310 .with_title("System Stats")
311 .with_width(30);
312
313 println!("\n📦 Panel Examples");
314 println!("===============");
315 println!("{}", welcome_panel);
316 println!("\n{}", stats_panel);
317}Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Examples found in repository?
examples/demo.rs (line 301)
295fn print_panel_demo() {
296 let welcome_panel = Panel::new(
297 "Welcome to Pinax - a powerful terminal UI toolkit for Rust! \
298 This panel demonstrates text wrapping and border styling capabilities. \
299 Long text will automatically wrap to fit within the specified width.",
300 )
301 .with_title("Welcome")
302 .with_width(60);
303
304 let stats_panel = Panel::new(
305 "📈 Active Users: 1,234\n\
306 🔄 Server Uptime: 99.9%\n\
307 💾 Memory Usage: 2.1GB\n\
308 🚀 Response Time: 45ms",
309 )
310 .with_title("System Stats")
311 .with_width(30);
312
313 println!("\n📦 Panel Examples");
314 println!("===============");
315 println!("{}", welcome_panel);
316 println!("\n{}", stats_panel);
317}pub fn with_style(self, style: BorderStyle) -> Self
Sourcepub fn with_width(self, width: usize) -> Self
pub fn with_width(self, width: usize) -> Self
Examples found in repository?
examples/demo.rs (line 302)
295fn print_panel_demo() {
296 let welcome_panel = Panel::new(
297 "Welcome to Pinax - a powerful terminal UI toolkit for Rust! \
298 This panel demonstrates text wrapping and border styling capabilities. \
299 Long text will automatically wrap to fit within the specified width.",
300 )
301 .with_title("Welcome")
302 .with_width(60);
303
304 let stats_panel = Panel::new(
305 "📈 Active Users: 1,234\n\
306 🔄 Server Uptime: 99.9%\n\
307 💾 Memory Usage: 2.1GB\n\
308 🚀 Response Time: 45ms",
309 )
310 .with_title("System Stats")
311 .with_width(30);
312
313 println!("\n📦 Panel Examples");
314 println!("===============");
315 println!("{}", welcome_panel);
316 println!("\n{}", stats_panel);
317}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Panel
impl RefUnwindSafe for Panel
impl Send for Panel
impl Sync for Panel
impl Unpin for Panel
impl UnwindSafe for Panel
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