bog

Crates.iobog
lib.rsbog
version0.1.0
sourcesrc
created_at2024-08-07 12:23:49.510799
updated_at2024-08-07 12:23:49.510799
descriptionThe highly-modular abstraction standard
homepagehttps://github.com/rtthw/bog
repositoryhttps://github.com/rtthw/bog
max_upload_size
id1328377
size46,791
Matthew Martin (rtthw)

documentation

README

Bog

The highly-modular abstraction standard.

Usage

The recommended design pattern to be used with this library is the basic type definition wrapper...

type Position = bog::Xy<u16>;

And implementing custom features should be done through extension traits...

trait PositionImpl {
    fn custom_x_getter(&self) -> u16;
}

impl PositionImpl for Position {
    fn custom_x_getter(&self) -> u16 {
        self.x
    }
}

With the following results...

let pos_a = Position::new(1, 2);

assert_eq!(pos_a.custom_x_getter(), 1);

Features

Name Rect X-Y X-Y-Z
default
all
rect
xy
xyz
Commit count: 0

cargo fmt