pub struct RangeSet { /* private fields */ }Implementations§
Source§impl RangeSet
impl RangeSet
pub const fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn insert(&mut self, new_range: Range)
pub fn remove(&mut self, range: &Range)
pub fn overlap(&self, range: &Range) -> bool
pub fn clear(&mut self)
pub fn enclosing_range(&self) -> Option<Range>
pub fn count(&self) -> u64
pub fn contains_index(&self, index: u64) -> bool
pub fn as_slice(&self) -> &[Range]
pub fn encoded_len(&self) -> usize
Trait Implementations§
Source§impl Decode for RangeSet
impl Decode for RangeSet
Source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl Encode for RangeSet
impl Encode for RangeSet
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl Extend<Range> for RangeSet
impl Extend<Range> for RangeSet
Source§fn extend<I: IntoIterator<Item = Range>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Range>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Range> for RangeSet
impl FromIterator<Range> for RangeSet
impl EncodeLike for RangeSet
impl Eq for RangeSet
impl StructuralPartialEq for RangeSet
Auto Trait Implementations§
impl Freeze for RangeSet
impl RefUnwindSafe for RangeSet
impl Send for RangeSet
impl Sync for RangeSet
impl Unpin for RangeSet
impl UnwindSafe for RangeSet
Blanket Implementations§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8]
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more