[−][src]Struct pelite::pe64::Ptr
Typed virtual address.
Methods
impl<T: ?Sized> Ptr<T>
[src]
pub const NULL: Ptr<T>
[src]
Null pointer constant.
pub const fn null() -> Ptr<T>
[src]
Creates a null pointer.
pub const fn is_null(self) -> bool
[src]
Returns true if the pointer is null.
pub const fn member(va: Va, offset: u32) -> Ptr<T>
[src]
Constructs a pointer with an offset.
pub const fn cast<U: ?Sized>(self) -> Ptr<U>
[src]
Casts the pointer to a different type keeping the pointer address fixed.
pub const fn offset<U: ?Sized>(self, offset: i64) -> Ptr<U>
[src]
Offsets and casts the pointer.
Because the type of the current and the target may be unrelated, this is a byte offset.
Examples
use pelite::pe64::Ptr; #[repr(C)] struct Composite { int: i32, float: f32, } let p: Ptr<Composite> = Ptr::from(0x2000); let target = p.offset::<f32>(4); assert_eq!(target, Ptr::from(0x2004));
pub const fn into_raw(self) -> Va
[src]
Returns the raw integer, type ascription helper.
impl<T> Ptr<[T]>
[src]
pub const fn decay(self) -> Ptr<T>
[src]
Decays the pointer from [T]
to T
.
pub const fn at(self, i: usize) -> Ptr<T>
[src]
Pointer arithmetic, gets the pointer of an element at the specified index.
Trait Implementations
impl<T: ?Sized> Pod for Ptr<T> where
Ptr<T>: 'static,
[src]
Ptr<T>: 'static,
fn zeroed() -> Self where
Self: Sized,
[src]
Self: Sized,
unsafe fn uninit() -> Self where
Self: Sized,
[src]
Self: Sized,
fn as_bytes(&self) -> &[u8]
[src]
fn as_bytes_mut(&mut self) -> &mut [u8]
[src]
impl<T: ?Sized> AsRef<u64> for Ptr<T>
[src]
impl<T: ?Sized> Eq for Ptr<T>
[src]
impl<T: ?Sized> Default for Ptr<T>
[src]
impl<T: ?Sized> Clone for Ptr<T>
[src]
impl<T: ?Sized> AsMut<u64> for Ptr<T>
[src]
impl<T: ?Sized> PartialOrd<Ptr<T>> for Ptr<T>
[src]
fn partial_cmp(&self, rhs: &Ptr<T>) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized> PartialEq<Ptr<T>> for Ptr<T>
[src]
impl<T: ?Sized> Ord for Ptr<T>
[src]
fn cmp(&self, rhs: &Ptr<T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: ?Sized> From<u64> for Ptr<T>
[src]
impl<T: ?Sized> From<Ptr<T>> for Va
[src]
impl<T: ?Sized> Copy for Ptr<T>
[src]
impl<T: ?Sized> Hash for Ptr<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: ?Sized> Debug for Ptr<T>
[src]
impl<T: ?Sized> Display for Ptr<T>
[src]
impl<T: ?Sized> LowerHex for Ptr<T>
[src]
impl<T: ?Sized> UpperHex for Ptr<T>
[src]
impl<T: ?Sized> Serialize for Ptr<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> Sync for Ptr<T>
impl<T: ?Sized> Send for Ptr<T>
impl<T: ?Sized> Unpin for Ptr<T>
impl<T: ?Sized> UnwindSafe for Ptr<T>
impl<T: ?Sized> RefUnwindSafe for Ptr<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,