# Border Struct Documentation
## Overview
The `Border` struct represents a bordered area with specific dimensions and position in the console. It allows you to easily create and display borders made of customizable characters.
## Fields
- **`border`**: `String`
- The character(s) used for the border.
- **`h`**: `u16`
- The height of the area defined by the border.
- **`w`**: `u16`
- The width of the area defined by the border.
- **`x`**: `u16`
- The x-coordinate position of the border's top-left corner.
- **`y`**: `u16`
- The y-coordinate position of the border's top-left corner.
## Methods
### `new`
```rust
pub fn new(h: u16, w: u16, x: u16, y: u16, border: String) -> Border
```
Creates a new instance of `Border`.
#### Parameters
- `h`: The height of the border area.
- `w`: The width of the border area.
- `x`: The x-coordinate of the border's position.
- `y`: The y-coordinate of the border's position.
- `border`: A string representing the border character(s).
#### Returns
Returns a new `Border` instance.
### `draw`
```rust
pub fn draw(&self)
```
Draws the border on the console.
This method prints the border starting at the specified (x, y) position. The border consists of repeated characters specified in the `border` field and is drawn for the height and width defined in the struct.
#### Example
```rust
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.
## Example Usage
```rust
fn main() {
let border = Border::new(5, 10, 2, 1, "*".to_string());
border.draw();
}
```
This code snippet demonstrates how to create a `Border` instance and draw it on the console.
## Conclusion
The `Border` struct provides a simple way to create visually appealing borders in console applications. Customize the appearance by changing the border character, width, height, and position.
### Explanation of the Structure:
- **Overview**: A brief introduction to the purpose of the struct.
- **Fields**: A breakdown of each field within the struct, explaining its type and purpose.
- **Methods**: Documentation for each method, including parameters, return values, and usage examples.
- **Example Usage**: A complete example of how to instantiate and use the `Border` struct in a Rust program.
- **Conclusion**: A summary of the utility of the `Border` struct.