Expand description
unmem crate contains some interesting functions. I tried to make them as safe as possible. However, remember that even not marked as unsafe they still can be dangerous. All of these functions may cause UB!
Macros
token stream -> cstr. Example:
Takes variable of one type and returns it as another type. EXTREMELY UNSAFE. Undefined Behavior or panic guaranteed.
Structs
Mean safe wrapper around raw pointers.
Null-terminated borrowed string type. Same layout as C’s “char*”. Only standard ASCII support (not cp1251!).
Traits
Used for method-like access. If you want to pass only a type, use is_copy macro instead.
Functions
Changes value of immutable variable.
Free memory by mutable reference.
Returns address from reference.
Gives you a mutable reference from immutable.
Similar to orient but returns &mut.
Read value of *const non-Copy T.
Reads the value from src
without moving it. This leaves the
memory in src
unchanged.
Analogue of memset.