pub struct Border {
pub border: String,
pub h: u16,
pub w: u16,
pub x: u16,
pub y: u16,
}Expand description
A structure representing a border with specific dimensions and position.
Fields§
§border: StringThe character or string used for the border.
h: u16The height of the area defined by the border.
w: u16The width of the area defined by the border.
x: u16The x-coordinate position of the border’s top-left corner.
y: u16The y-coordinate position of the border’s top-left corner.
Implementations§
Source§impl Border
impl Border
Sourcepub fn draw(&self)
pub fn draw(&self)
Draws the border on the console.
This method will print the border to the console starting at the specified
(x, y) position. The border consists of repeated characters specified
in the border field, and it is drawn for the height and width defined
in the struct.
§Example
let border = Border::new(5, 10, 2, 1, "*".to_string());
border.draw();This will create a border 10 characters wide and 5 characters high, starting from the x-coordinate 2 and y-coordinate 1.
Auto Trait Implementations§
impl Freeze for Border
impl RefUnwindSafe for Border
impl Send for Border
impl Sync for Border
impl Unpin for Border
impl UnwindSafe for Border
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