Unsafe operations
bump_box_refcount
- Force-increment the reference count on a shared boxforget
- Move a thing into the voidreinterpret_cast
- Casts the value at src
to Utransmute
- Transform a value of one type into a value of another typebump_box_refcount
unsafe fn bump_box_refcount<T>(+t: @T)
Force-increment the reference count on a shared box. If used uncarefully, this can leak the box. Use this in conjunction with transmute and/or reinterpret_cast when such calls would otherwise scramble a box's reference count
forget
unsafe fn forget<T>(-thing: T)
Move a thing into the void
The forget function will take ownership of the provided value but neglect to run any required cleanup or memory-management operations on it. This can be used for various acts of magick, particularly when using reinterpret_cast on managed pointer types.
reinterpret_cast
unsafe fn reinterpret_cast<T, U>(src: T) -> U
Casts the value at src
to U. The two types must have the same length.
transmute
unsafe fn transmute<L, G>(-thing: L) -> G
Transform a value of one type into a value of another type. Both types must have the same size and alignment.
assert transmute("L") == [76u8, 0u8]/~;