Expand description
Range calculation helper.
The author of this crate is not good at English.
Forgive me if the document is hard to read.
§Examples
use rich_range::prelude::*;
let r = rw::new(30..60) & rw::new(40..70);
assert_eq!(r.0, 40..60);
let r = ru::new(30..) & ru::new(..60);
assert_eq!(r, ru::new(30..60));§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
Re-exports§
pub use values::*;
Modules§
- conv
- Range type conversions.
- norm
- Bounds normalizer.
- parts
- Range parts.
- prelude
- Crate’s prelude.
- shorthands
- Short names.
- values
- Traits for single value.
Structs§
- Iter
Rich Range - An Iterator over the values on range.
- Range
Univ - Range with universal bounds.
- Range
View - Range viewer for abstraction.
- Range
Wrapper - Range wrapper for type keeping calculation.
Enums§
- Cursor
Mode - Cursor mode.
- CutMode
- Cut mode.
- PosStyle
- Number system of position.
- Range
Rel - Range position relation.
Traits§
- Rich
Range Bounds - Rich version of
RangeBounds.