porous

Crates.ioporous
lib.rsporous
version0.1.0
sourcesrc
created_at2023-08-24 01:53:54.031256
updated_at2023-08-24 01:53:54.031256
descriptionNon-contigous range implementation
homepage
repositoryhttps://git.43615.xyz/voidentente/porous
max_upload_size
id953214
size4,256
__________ (voidentente)

documentation

README

Nightly Only

step_trait is required for marking the generic Item as iterable. See the requirement for RangeInclusive::into_iter.

About

 1 2 3 4 5 6 7 8         1 2 3 4 5 6 7 8
[---------------] - 4 = [-----] [-------]

The main structure this crate provides is PorousRange, which abstracts over an indefinite amount of ranges (i.e. requires allocation) to simulate one non-contigous one.

PorousRange accepts any inner generic item that is num_traits::One, core::iter::Step, core::marker::Copy, core::ops::Add, and core::ops::Sub. These requirements are fulfilled by every built-in integer.

An item is never contained in more than one inner range and can be removed, if it is contained, so that range is removed and up to two new ranges are pushed so that PorousRangen \ PorousRangen + 1 = { item }.

Features

  • serde: Implement Serialize and Deserialize on PorousRange
Commit count: 0

cargo fmt