Struct FancySlice

Source
pub struct FancySlice<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> FancySlice<'a>

Source

pub fn new(data: &[u8]) -> FancySlice<'_>

Source

pub fn relative_fancy_slice<T: RangeBounds<usize>>( &self, range: T, ) -> FancySlice<'_>

Source

pub fn absolute_fancy_slice<T: RangeBounds<usize>>( &self, range: T, ) -> FancySlice<'_>

Requires debug feature.

Source

pub fn relative_slice<I: SliceIndex<[u8], Output = [u8]>>( &self, range: I, ) -> &[u8]

Source

pub fn absolute_slice<I: SliceIndex<[u8], Output = [u8]>>( &self, range: I, ) -> &[u8]

Requires debug feature.

Source

pub fn u8(&self, offset: usize) -> u8

Source

pub fn i16_be(&self, offset: usize) -> i16

Source

pub fn u16_be(&self, offset: usize) -> u16

Source

pub fn i32_be(&self, offset: usize) -> i32

Source

pub fn u32_be(&self, offset: usize) -> u32

Source

pub fn f32_be(&self, offset: usize) -> f32

Source

pub fn str(&self, offset: usize) -> Result<&str, String>

Source

pub fn len(&self) -> usize

Source

pub fn offset(&self) -> usize

Requires debug feature. Returns the offset into the original slice.

Source

pub fn hex<I: SliceIndex<[u8], Output = [u8]>>(&self, range: I) -> String

Debug display each byte in hex

Source

pub fn ascii<I: SliceIndex<[u8], Output = [u8]>>(&self, range: I) -> String

Debug display each byte as an ascii character if valid, otherwise display as ‘.’

Source

pub fn find_i8(&self, search_for: i8) -> Vec<usize>

Requires debug feature.

Source

pub fn find_u8(&self, search_for: u8) -> Vec<usize>

Requires debug feature.

Source

pub fn find_i16(&self, search_for: i16) -> Vec<usize>

Requires debug feature.

Source

pub fn find_u16(&self, search_for: u16) -> Vec<usize>

Requires debug feature.

Source

pub fn find_i32(&self, search_for: i32) -> Vec<usize>

Requires debug feature.

Source

pub fn find_u32(&self, search_for: u32) -> Vec<usize>

Requires debug feature.

Source

pub fn find_offset_pointers(&self, search_for_address: usize) -> Vec<usize>

Requires debug feature.

Trait Implementations§

Source§

impl<'a> Clone for FancySlice<'a>

Source§

fn clone(&self) -> FancySlice<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for FancySlice<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for FancySlice<'a>

§

impl<'a> RefUnwindSafe for FancySlice<'a>

§

impl<'a> Send for FancySlice<'a>

§

impl<'a> Sync for FancySlice<'a>

§

impl<'a> Unpin for FancySlice<'a>

§

impl<'a> UnwindSafe for FancySlice<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.