pub struct DebugRange {
    pub start: usize,
    pub end: usize,
}
Expand description

Represents a range of bytes in the KSM file, from the beginning of the code sections, that store the opcodes for the DebugEntry which will contain this range.

Fields§

§start: usize

The start of this range in bytes

§end: usize

The end of this range in bytes

Implementations§

source§

impl DebugRange

source

pub fn new(start: usize, end: usize) -> Self

Creates a new debug range with the specified start and end

source

pub fn size_bytes(&self, range_size: IntSize) -> usize

Returns the size of a debug range in bytes, using the provided range size

source

pub fn write(&self, buf: &mut Vec<u8>, range_size: IntSize)

Converts this range to bytes and writes it to the provided buffer.

This requires that the range size in bytes is specified, which describes how many bytes are required to describe a range start or end.

The range size is based off of the length of the file, and is the debug section counterpart to NumArgIndexBytes

source

pub fn parse( source: &mut BufferIterator<'_>, range_size: IntSize ) -> Result<Self, ()>

Parses a debug range, using the provided range size

The only reason that this can fail is if we run out of bytes

Trait Implementations§

source§

impl Clone for DebugRange

source§

fn clone(&self) -> DebugRange

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for DebugRange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<DebugRange> for DebugRange

source§

fn eq(&self, other: &DebugRange) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for DebugRange

source§

impl Eq for DebugRange

source§

impl StructuralEq for DebugRange

source§

impl StructuralPartialEq for DebugRange

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.