> built-in type
ptr
methods of ptr values
in the browser
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.
> methods
#
ptr.is_null() -> boolWhether the address is 0.
The pointer moved by n bytes, which may be negative. The address wraps around instead of failing.
> 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());
}