Struct fancy_slice::FancySlice
source · pub struct FancySlice<'a> { /* private fields */ }
Implementations§
source§impl<'a> FancySlice<'a>
impl<'a> FancySlice<'a>
pub fn new(data: &[u8]) -> FancySlice<'_>
pub fn relative_fancy_slice<T: RangeBounds<usize>>(
&self,
range: T
) -> FancySlice<'_>
sourcepub fn absolute_fancy_slice<T: RangeBounds<usize>>(
&self,
range: T
) -> FancySlice<'_>
pub fn absolute_fancy_slice<T: RangeBounds<usize>>(
&self,
range: T
) -> FancySlice<'_>
Requires debug
feature.
pub fn relative_slice<I: SliceIndex<[u8], Output = [u8]>>(
&self,
range: I
) -> &[u8] ⓘ
sourcepub fn absolute_slice<I: SliceIndex<[u8], Output = [u8]>>(
&self,
range: I
) -> &[u8] ⓘ
pub fn absolute_slice<I: SliceIndex<[u8], Output = [u8]>>(
&self,
range: I
) -> &[u8] ⓘ
Requires debug
feature.
pub fn u8(&self, offset: usize) -> u8
pub fn i16_be(&self, offset: usize) -> i16
pub fn u16_be(&self, offset: usize) -> u16
pub fn i32_be(&self, offset: usize) -> i32
pub fn u32_be(&self, offset: usize) -> u32
pub fn f32_be(&self, offset: usize) -> f32
pub fn str(&self, offset: usize) -> Result<&str, String>
pub fn len(&self) -> usize
sourcepub fn offset(&self) -> usize
pub fn offset(&self) -> usize
Requires debug
feature.
Returns the offset into the original slice.
sourcepub fn hex<I: SliceIndex<[u8], Output = [u8]>>(&self, range: I) -> String
pub fn hex<I: SliceIndex<[u8], Output = [u8]>>(&self, range: I) -> String
Debug display each byte in hex
sourcepub fn ascii<I: SliceIndex<[u8], Output = [u8]>>(&self, range: I) -> String
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 ‘.’
sourcepub fn find_offset_pointers(&self, search_for_address: usize) -> Vec<usize>
pub fn find_offset_pointers(&self, search_for_address: usize) -> Vec<usize>
Requires debug
feature.
Trait Implementations§
source§impl<'a> Clone for FancySlice<'a>
impl<'a> Clone for FancySlice<'a>
source§fn clone(&self) -> FancySlice<'a>
fn clone(&self) -> FancySlice<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more