Struct kerbalobjects::ksm::sections::DebugRange
source · 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
impl DebugRange
sourcepub fn new(start: usize, end: usize) -> Self
pub fn new(start: usize, end: usize) -> Self
Creates a new debug range with the specified start and end
sourcepub fn size_bytes(&self, range_size: IntSize) -> usize
pub fn size_bytes(&self, range_size: IntSize) -> usize
Returns the size of a debug range in bytes, using the provided range size
sourcepub fn write(&self, buf: &mut Vec<u8>, range_size: IntSize)
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
Trait Implementations§
source§impl Clone for DebugRange
impl Clone for DebugRange
source§fn clone(&self) -> DebugRange
fn clone(&self) -> DebugRange
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 moresource§impl Debug for DebugRange
impl Debug for DebugRange
source§impl PartialEq<DebugRange> for DebugRange
impl PartialEq<DebugRange> for DebugRange
source§fn eq(&self, other: &DebugRange) -> bool
fn eq(&self, other: &DebugRange) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for DebugRange
impl Eq for DebugRange
impl StructuralEq for DebugRange
impl StructuralPartialEq for DebugRange
Auto Trait Implementations§
impl RefUnwindSafe for DebugRange
impl Send for DebugRange
impl Sync for DebugRange
impl Unpin for DebugRange
impl UnwindSafe for DebugRange
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