pub(crate) fn from_bitslice<C>(bs: &SliceBit<C, T>) -> Self
	where C: Cursor {
		let src = unsafe { &*(bs as *const SliceBit<C, T> as *const [()]) };
		let ptr = Pointer::from(src.as_ptr() as *const u8);
		let (ptr, len) = match (ptr.w(), src.len()) {
			(_, 0) => (NonNull::dangling(), 0),
			(p, _) if p.is_null() => unreachable!("Rust forbids null refs"),
			(p, l) => (unsafe { NonNull::new_unchecked(p) }, l),
		};
		Self { ptr, len, _ty: PhantomData }
	}
/// Converts a `SliceBit` handle into its `BitPtr` representation.
///
/// # Parameters
///
/// - `bs: &SliceBit<C, T>`: a `SliceBit` handle
///
/// # Returns
///
/// The `BitPtr<T>` structure composing the handle.
Converts a `SliceBit` handle into its `BitPtr` representation.
Converts a ` SliceBit ` handle into its ` BitPtr ` representation .
pub(crate) fn from_bitslice<C>(bs: &SliceBit<C, T>) -> Self
	where C: Cursor {
		let src = unsafe { &*(bs as *const SliceBit<C, T> as *const [()]) };
		let ptr = Pointer::from(src.as_ptr() as *const u8);
		let (ptr, len) = match (ptr.w(), src.len()) {
			(_, 0) => (NonNull::dangling(), 0),
			(p, _) if p.is_null() => unreachable!("Rust forbids null refs"),
			(p, l) => (unsafe { NonNull::new_unchecked(p) }, l),
		};
		Self { ptr, len, _ty: PhantomData }
	}
pub ( crate ) fn from_bitslice < C > ( bs : & SliceBit < C , T > ) -> Self where C : Cursor { let src = unsafe { & * ( bs as * const SliceBit < C , T > as * const [ ( ) ] ) } ; let ptr = Pointer :: from ( src . as_ptr ( ) as * const u8 ) ; let ( ptr , len ) = match ( ptr . w ( ) , src . len ( ) ) { ( _ , 0 ) => ( NonNull :: dangling ( ) , 0 ) , ( p , _ ) if p . is_null ( ) => unreachable ! ( " " ) , ( p , l ) => ( unsafe { NonNull :: new_unchecked ( p ) } , l ) , } ; Self { ptr , len , _ty : PhantomData } }
Converts a `SliceBit` handle into its `BitPtr` representation.
Converts a ` SliceBit ` handle into its ` BitPtr ` representation .
bs
&SliceBit<C, T>
The `BitPtr` structure composing the handle.
The ` BitPtr ` structure composing the handle .
bs
&SliceBit<C, T>
bs: &SliceBit<C, T>
a `SliceBit` handle
a ` SliceBit ` handle