Releases: AQUIN0S/FixedBitmaps
Larger Bitmap functionality
Implement some functionality for larger bitmaps, and some tests. I apparently missed releasing 0.10.0 here, so I'll just stick with the 0.10.2.
Added larger bitmaps
Added bitmap structs that hold 256 - 8192 bits, was going to go higher but it looks like that can start leading to stack overflows and heap options would be better at that point. At this point these structs are still unstable and lack some functionality.
Implement dereference operator, more documentation
As the title suggests, the Deref
trait has now been implemented on Bitmaps
, so the following code could work:
use fixed_bitmaps::Bitmap64;
let a = Bitmap64::from(0b1010);
assert_eq!(*a, 0b1010);
Also plenty of docs changes were made!
Implement not operations
In terms of functionality, this is a relatively small update. Using the NOT (!) operator is now allowed, like the following:
use fixed_bitmaps::Bitmap64;
let a = Bitmap64::from(0b1010);
let b = !a;
In terms of maintenance, this is a massive update, as two scripts have been added which apply changes in the bitmap128.rs
and test_bitmap128.rs
files, and apply them to all of the other types of bitmaps instantly. This will make future updates come much easier, as I can now quit worrying about having to copy and paste stuff correctly!
Implementing shifts
Bitwise shifts are now implemented, so you can make statements such as:
let mut bitmap = Bitmap8::from(0b0101);
bitmap <<= 2;
println!("{}", bitmap); // Prints 00010100
Updated Documentation
This patch I mainly focused on improving the consistency of all of the documentation, and making sure all of the examples were working as they should. I also introduced Travis CI in this commit, for fun!
Added BitmapArch
Added the BitmapArch
struct, which wraps a usize
. This should be the fastest bitmap to work with in general, as it will adapt to the target hardware architecture for whether to use a u32
or a u64
as its underlying primitive. This does come at the cost of some transparency though, so in most cases it should probably be assumed to only have a length of 32 bits, and the user shouldn't rely on it to have 64.
Arithmetic operations
Added arithmetic operations to the Bitmaps, which can be between two Bitmaps of the same type, or between a Bitmap and its respective integer type. To make it feel more complete, the same treatment was done to the existing bitwise operations, so now a Bitmap can AND, OR and XOR with their integer types as well, not just other Bitmaps.
Fully Wrapped u8-u128
Version 0.3.0
As the title suggests, almost all of Rust's primary unsigned integer types have been fully wrapped now, with the exception of usize
.
Features
- There are now wrappings for all basic types of unsigned integers, from u8 up to u128.
- AND, OR and XOR functionality fully implemented.
- Implements Display to show the bitmap in all its 1's and 0's glory. (May end up changing this to the Debug trait however, that'll have to be something to think about before releasing 1.0.0).
- Easy conversion between a Bitmap and the integer type it's associated with. For example, a Bitmap64 and a u64 can easily be converted back and forth.