pub fn contains<M2, T2>(&self, pointer: &BitPtr<M2, T2, O>) -> bool
	where
		M2: Mutability,
		T2: BitStore,
	{
		dvl::match_store::<T::Mem, T2::Mem>()
			&& self.start <= *pointer
			&& *pointer < self.end
	}
/// Tests if a given bit-pointer is contained within the range.
///
/// Bit-pointer ordering is defined when the types have the same exact
/// `BitOrder` type parameter and the same `BitStore::Mem` associated type
/// (but are free to differ in alias condition!). Inclusion in a range
/// occurs when the bit-pointer is not strictly less than the range start,
/// and is strictly less than the range end.
///
/// ## Original
///
/// [`Range::contains`](core::ops::Range::contains)
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
/// use bitvec::ptr::BitPtrRange;
/// use core::cell::Cell;
///
/// let data = 0u16;
/// let bp = BitPtr::<_, _, Lsb0>::from_ref(&data);
///
/// let mut range = BitPtrRange::from_range(bp .. bp.wrapping_add(16));
/// range.nth(2);
/// range.nth_back(2);
///
/// assert!(bp < range.start);
/// assert!(!range.contains(&bp));
///
/// let mid = bp.wrapping_add(8);
///
/// let same_mem = mid.cast::<Cell<u16>>();
/// assert!(range.contains(&mid));
/// ```
///
/// Casting to a different `BitStore` type whose `Mem` parameter differs
/// from the range always results in a `false` response, even if the pointer
/// being tested is numerically within the range.
Tests if a given bit-pointer is contained within the range.
Bit-pointer ordering is defined when the types have the same exact
`BitOrder` type parameter and the same `BitStore::Mem` associated type
(but are free to differ in alias condition!). Inclusion in a range
occurs when the bit-pointer is not strictly less than the range start,
and is strictly less than the range end.
Tests if a given bit - pointer is contained within the range . Bit - pointer ordering is defined when the types have the same exact ` BitOrder ` type parameter and the same ` BitStore :: Mem ` associated type ( but are free to differ in alias condition! ) . Inclusion in a range occurs when the bit - pointer is not strictly less than the range start and is strictly less than the range end .
pub fn contains<M2, T2>(&self, pointer: &BitPtr<M2, T2, O>) -> bool
	where
		M2: Mutability,
		T2: BitStore,
	{
		dvl::match_store::<T::Mem, T2::Mem>()
			&& self.start <= *pointer
			&& *pointer < self.end
	}
pub fn contains < M2 , T2 > ( & self , pointer : & BitPtr < M2 , T2 , O > ) -> bool where M2 : Mutability , T2 : BitStore , { dvl :: match_store :: < T :: Mem , T2 :: Mem > ( ) && self . start <= * pointer && * pointer < self . end }
Tests if a given bit-pointer is contained within the range.
Tests if a given bit - pointer is contained within the range .
&self
pointer
&BitPtr<M2, T2, O>
&self
pointer
&BitPtr<M2, T2, O>
original
None
examples
```rust
use bitvec::prelude::*;
use bitvec::ptr::BitPtrRange;
use core::cell::Cell.



let mut range = BitPtrRange::from_range(bp ..

assert!(bp < range.start);
assert!(!range.contains(&bp)).

let mid = bp.wrapping_add(8).



Casting to a different `BitStore` type whose `Mem` parameter differs
from the range always results in a `false` response, even if the pointer
being tested is numerically within the range.
` ` ` rust use bitvec :: prelude :: * ; use bitvec :: ptr :: BitPtrRange ; use core :: cell :: Cell . let mut range = BitPtrRange :: from_range ( bp .. assert! ( bp < range . start ) ; assert! ( !range . contains ( &bp )) . let mid = bp . wrapping_add ( 8 ) . Casting to a different ` BitStore ` type whose ` Mem ` parameter differs from the range always results in a ` false ` response even if the pointer being tested is numerically within the range .