RIP
Tutorial
Tags
Topics
Examples
eBooks
Download Rust (PDF)
Rust
Getting started with Rust
Awesome Book
Awesome Community
Awesome Course
Awesome Tutorial
Awesome YouTube
Arrays, Vectors and Slices
Associated Constants
Auto-dereferencing
Bare Metal Rust
Boxed values
Cargo
Closures and lambda expressions
Command Line Arguments
Conversion traits
Custom derive: "Macros 1.1"
Documentation
Error handling
File I/O
Foreign Function Interface (FFI)
Futures and Async IO
Generics
Globals
GUI Applications
Inline Assembly
Iron Web Framework
Iterators
Lifetimes
Loops
Macros
Modules
Object-oriented Rust
Operators and Overloading
Option
Ownership
Panics and Unwinds
Parallelism
Pattern Matching
PhantomData
Primitive Data Types
Random Number Generation
Raw Pointers
Chain-dereferencing
Creating and using constant raw pointers
Creating and using mutable raw pointers
Displaying raw pointers
Initialising a raw pointer to null
Regex
Rust Style Guide
rustup
Serde
Signal handling
Strings
Structures
TCP Networking
Tests
The Drop Trait - Destructors in Rust
Traits
Tuples
Unsafe Guidelines
Rust
Getting started with Rust
Awesome Book
Awesome Community
Awesome Course
Awesome Tutorial
Awesome YouTube
Arrays, Vectors and Slices
Associated Constants
Auto-dereferencing
Bare Metal Rust
Boxed values
Cargo
Closures and lambda expressions
Command Line Arguments
Conversion traits
Custom derive: "Macros 1.1"
Documentation
Error handling
File I/O
Foreign Function Interface (FFI)
Futures and Async IO
Generics
Globals
GUI Applications
Inline Assembly
Iron Web Framework
Iterators
Lifetimes
Loops
Macros
Modules
Object-oriented Rust
Operators and Overloading
Option
Ownership
Panics and Unwinds
Parallelism
Pattern Matching
PhantomData
Primitive Data Types
Random Number Generation
Raw Pointers
Chain-dereferencing
Creating and using constant raw pointers
Creating and using mutable raw pointers
Displaying raw pointers
Initialising a raw pointer to null
Regex
Rust Style Guide
rustup
Serde
Signal handling
Strings
Structures
TCP Networking
Tests
The Drop Trait - Destructors in Rust
Traits
Tuples
Unsafe Guidelines
Rust
Raw Pointers
Fastest Entity Framework Extensions
Bulk Insert
Bulk Delete
Bulk Update
Bulk Merge
Syntax
let raw_ptr = &pointee as *const
type
// create constant raw pointer to some data
let raw_mut_ptr = &mut pointee as *mut
type
// create mutable raw pointer to some mutable data
let deref = *raw_ptr // dereference a raw pointer (requires unsafe block)
Remarks
Raw pointers are not guaranteed to point to a valid memory address and as such, careless usage may lead to unexpected (and probably fatal) errors.
Any normal Rust reference (eg.
&my_object
where the type of
my_object
is T) will coerce to
*const T
. Similarly, mutable references coerce to
*mut T
.
Raw pointers do not move ownership (in contrast to Box values that)
Raw Pointers Related Examples
Chain-dereferencing
Creating and using constant raw pointers
Creating and using mutable raw pointers
Displaying raw pointers
Initialising a raw pointer to null
Got any Rust Question?
Ask any Rust Questions and Get Instant Answers from ChatGPT AI:
ChatGPT answer me!
PDF
- Download
Rust
for free
Previous
Next
Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our
Cookie Policy
and
Privacy Policy
Accept all Cookies
Leave this website