1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
//! This crate generalises traits over the `len` and `capacity` methods found in most collections. //! //! Methods that are included: //! //! * [`capacity`] //! * [`clear`] //! * [`is_empty`] //! * [`len`] //! * [`reserve_exact`] //! * [`reserve`] //! * [`shrink_to_fit`] //! * [`split_at_mut`] //! * [`split_at`] //! * [`split_off`] //! * [`truncate`] //! * [`with_capacity`] //! //! Additionally, the traits [`IndexRanges<Idx>`] and [`IndexRangesMut<Idx>`] are provided for //! "consistent slicing," i.e. slicing over all range types. //! //! [`IndexRanges<Idx>`]: index/trait.IndexRanges.html //! [`IndexRangesMut<Idx>`]: index/trait.IndexRangesMut.html //! [`capacity`]: capacity/trait.Capacity.html#tymethod.capacity //! [`clear`]: len/trait.Clear.html#tymethod.clear //! [`is_empty`]: len/trait.Len.html#method.is_empty //! [`len`]: len/trait.Len.html#tymethod.len //! [`reserve_exact`]: capacity/trait.CapacityMut.html#method.reserve_exact //! [`reserve`]: capacity/trait.CapacityMut.html#tymethod.reserve //! [`shrink_to_fit`]: capacity/trait.CapacityMut.html#method.shrink_to_fit //! [`split_at_mut`]: index/trait.SplitAtMut.html#tymethod.split_at_mut //! [`split_at`]: index/trait.SplitAt.html#tymethod.split_at //! [`split_off`]: len/trait.LenMut.html#tymethod.split_off //! [`truncate`]: len/trait.LenMut.html#tymethod.truncate //! [`with_capacity`]: capacity/trait.WithCapacity.html#tymethod.with_capacity #![cfg_attr(all(not(feature = "std"), feature = "collections"), feature(collections))] #![cfg_attr(feature = "nightly", feature(inclusive_range))] #![cfg_attr(all(feature = "nightly", feature = "std"), feature(osstring_shrink_to_fit))] #![cfg_attr(not(feature = "std"), feature(core_slice_ext, core_str_ext))] #![cfg_attr(not(feature = "std"), no_std)] #![doc(html_root_url = "https://docs.charr.xyz/len-trait/")] #![deny(warnings)] #[cfg(feature = "bit-set")] extern crate bit_set; #[cfg(feature = "bit-vec")] extern crate bit_vec; #[cfg(feature = "blist")] extern crate blist; #[cfg(feature = "enum-set")] extern crate enum_set; #[cfg(feature = "interval-heap")] extern crate interval_heap; #[cfg(feature = "linear-map")] extern crate linear_map; #[cfg(feature = "linked-hash-map")] extern crate linked_hash_map; #[cfg(feature = "lru-cache")] extern crate lru_cache; #[cfg(feature = "vec_map")] extern crate vec_map; #[cfg(all(not(feature = "std"), feature = "collections"))] extern crate collections; pub mod capacity; pub mod index; pub mod len; pub use capacity::*; pub use index::*; pub use len::*; mod impls;