xur_

> module

std::ptr

raw pointer utilities

use std::ptr; feature ptr native only

A ptr is a raw 64-bit address. It prints in hex, and adding or subtracting an integer with + and - moves it by that many bytes. std::ptr makes pointers, and pointer values have the methods below. None of them read or write memory; see xur.std.mem(7) for that.

> functions

# from_int(addr: i64) -> ptr

The pointer to address addr. A negative address raises a runtime error.

# null() -> ptr

The null pointer, address 0.

> examples

use std::ptr;
use std::io;

fn main() {
    let p = ptr::from_int(0x1000);
    io::println("addr: {}", p.offset(16).to_hex());
    io::println("null? {}", ptr::null().is_null());
}