pub struct Offset(/* private fields */);
Expand description
Represents an offset that can be used to compute an absolute address.
This struct wraps a usize
value, which directly corresponds to an offset.
use commonlibsse_ng::rel::offset::Offset;
use commonlibsse_ng::rel::ResolvableAddress as _;
let offset = Offset::new(0x1000);
assert_eq!(offset.offset().unwrap(), core::num::NonZero::new(0x1000).unwrap());
Implementations§
Trait Implementations§
Source§impl Ord for Offset
impl Ord for Offset
Source§impl PartialOrd for Offset
impl PartialOrd for Offset
Source§impl ResolvableAddress for Offset
impl ResolvableAddress for Offset
Source§fn offset(&self) -> Result<NonZeroUsize, DataBaseError>
fn offset(&self) -> Result<NonZeroUsize, DataBaseError>
Source§impl TryFrom<Offset> for Relocation
impl TryFrom<Offset> for Relocation
impl Copy for Offset
impl Eq for Offset
impl StructuralPartialEq for Offset
Auto Trait Implementations§
impl Freeze for Offset
impl RefUnwindSafe for Offset
impl Send for Offset
impl Sync for Offset
impl Unpin for Offset
impl UnwindSafe for Offset
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