pub struct Match<'haystack> { /* private fields */ }
Expand description
Represents a matching Needle
found in the haystack.
Implementations§
source§impl<'haystack> Match<'haystack>
impl<'haystack> Match<'haystack>
sourcepub fn start(&self) -> usize
pub fn start(&self) -> usize
The position of the first byte in the matching needle, relative to the haystack.
let needle = DynamicNeedle::from_ida("63 ? 74").unwrap();
let haystack = "a_cat_tries";
let matched = needle.find(haystack.as_bytes()).unwrap();
assert_eq!(matched.start(), 2);
sourcepub fn end(&self) -> usize
pub fn end(&self) -> usize
The position of the last byte past the end of the matching needle, relative to the haystack.
let needle = DynamicNeedle::from_ida("63 ? 74").unwrap();
let haystack = "a_cat_tries";
let matched = needle.find(haystack.as_bytes()).unwrap();
assert_eq!(matched.end(), 5);
Trait Implementations§
impl<'haystack> Copy for Match<'haystack>
Auto Trait Implementations§
impl<'haystack> Freeze for Match<'haystack>
impl<'haystack> RefUnwindSafe for Match<'haystack>
impl<'haystack> Send for Match<'haystack>
impl<'haystack> Sync for Match<'haystack>
impl<'haystack> Unpin for Match<'haystack>
impl<'haystack> UnwindSafe for Match<'haystack>
Blanket Implementations§
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)