appcui 0.4.8

A feature-rich and cross-platform TUI/CUI framework for Rust, enabling modern terminal-based applications on Windows, Linux, and macOS. Includes built-in UI components like buttons, menus, list views, tree views, checkboxes, and more. Perfect for building fast and interactive CLI tools and text-based interfaces.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// This module defines a `Point` struct representing a point in 2D space with x and y coordinates.
#[derive(Copy, Clone, Debug, PartialEq, Default)]
pub struct Point {
    pub x: i32,
    pub y: i32,
}
impl Point {
    /// The origin point (0, 0).
    pub const ORIGIN: Point = Point { x: 0, y: 0 };
    
    /// Creates a new `Point` with the specified x and y coordinates.
    pub fn new(x: i32, y: i32) -> Self {
        Point { x, y }
    }
}