rich_range
Range calculation helper.
The author of this crate is not good at English.
Forgive me if the document is hard to read.
Examples
use *;
let r = new & new;
assert_eq!;
let r = new & new;
assert_eq!;
Highlights
This crate is designed with the following focus.
- Multiple range operations with sufficient variety.
- Abstraction and normalization of bound variants.
- Interoperability with Rust standard ranges in short code.
- Similar usage style to Rust new range API (nightly as of 2025).
Core items
RichRangeBounds<T>- Rich version ofRangeBounds<T>RangeUniv<T>- For universal bound types (fromru::new)RangeView<'a, R, T>- For all range type abstraction (fromrv::new)RangeWrapper<R, T>- For type keeping calculation (fromrw::new)
Cheat sheet
Following is a rough list of items.
-
Value(s) -> Range
-
Range -> Boolean
is_empty,is_broken,is_cursor,is_cursor_fwd,is_cursor_bwd,is_point,is_wide,is_full -
Range -> Value
head,tail,prev,next,cursor,point,len,size,width,start_edge,end_edge,bounds,edges,iter -
Range -> Range(s)
as_ref,cast,try_cast,to_range,into_option,flip,flip_adv -
Range + Value -> Boolean
-
Range + Value -> Range(s)
add_start,add_end,sub_start,sub_end,calc_start,calc_end,align_start,align_end,map,try_map,checked_shl,checked_shr,checked_add_start,checked_add_end,checked_sub_start,checked_sub_end,checked_calc_start,checked_calc_end,checked_align_start,checked_align_end,cutRangeUniv⋯<<,>>,<<=,>>=,with_start_bound,with_end_boundRangeWrapper⋯<<,>>,<<=,>>= -
Range + Range -> Boolean
equiv,intersects,includes,included,adjoins,adjoins_prev,adjoins_next,touches,touches_prev,touches_next -
Range + Range -> Value
-
Range + Range -> Range(s)
interval,interval_adv,prod,enwrap,union,diff,diff_adv -
Indexing
History
See CHANGELOG.