pub unsafe fn with_position(needle: N, position: usize) -> Self {
        // Implicitly checks that the needle is not empty because position is an
        // unsized integer.
        assert!(position < needle.size());

        let bytes = needle.as_bytes();
        if let Some(size) = N::SIZE {
            assert_eq!(size, bytes.len());
        }

        let neon_hash = VectorHash::new(bytes[0], bytes[position]);
        let neon_half_hash = VectorHash::new(bytes[0], bytes[position]);

        Self {
            position,
            neon_hash,
            neon_half_hash,
            needle,
        }
    }
/// Same as `new` but allows additionally specifying the `position` to use.
///
/// # Panics
///
/// Panics if `needle` is empty, if `position` is not a valid index for
/// `needle` or if the associated `SIZE` constant does not correspond to the
/// actual size of `needle`.
Same as `new` but allows additionally specifying the `position` to use.
Same as ` new ` but allows additionally specifying the ` position ` to use .
pub unsafe fn with_position(needle: N, position: usize) -> Self {
        // Implicitly checks that the needle is not empty because position is an
        // unsized integer.
        assert!(position < needle.size());
        let bytes = needle.as_bytes();
        if let Some(size) = N::SIZE {
            assert_eq!(size, bytes.len());
        }
        let neon_hash = VectorHash::new(bytes[0], bytes[position]);
        let neon_half_hash = VectorHash::new(bytes[0], bytes[position]);
        Self {
            position,
            neon_hash,
            neon_half_hash,
            needle,
        }
    }
pub unsafe fn with_position ( needle : N , position : usize ) -> Self { // Implicitly checks that the needle is not empty because position is an // unsized integer. assert ! ( position needle size ( ) ) ; let bytes = needle . as_bytes ( ) ; if let Some ( size ) = N :: SIZE { assert_eq ! ( size bytes len ( ) ) ; } let neon_hash = VectorHash :: new ( bytes [ 0 ] , bytes [ position ] ) ; let neon_half_hash = VectorHash :: new ( bytes [ 0 ] , bytes [ position ] ) ; Self { position , neon_hash , neon_half_hash , needle , } }
Same as `new` but allows additionally specifying the `position` to use.
Same as ` new ` but allows additionally specifying the ` position ` to use .
needle
N
position
usize
needle
N
position
usize
panics
Panics if `needle` is empty, if `position` is not a valid index for
`needle` or if the associated `SIZE` constant does not correspond to the
actual size of `needle`.
Panics if ` needle ` is empty if ` position ` is not a valid index for ` needle ` or if the associated ` SIZE ` constant does not correspond to the actual size of ` needle ` .