Totally Speedy Transmute (TST) is a library providing a small, performance oriented, safe version of std::mem::transmute

Overview

Totally Speedy Transmute

An evil spiritual successor to Totally Safe Transmute

What is it?

Totally Speedy Transmute (TST) is a library providing a small, performance oriented, safe version of std::mem::transmute. TST is intended for:

  • Totally Safe Transmute users looking for a windows-compatible alternative.
  • Programmers working in #![forbid(unsafe_code)] codebases who dislike their co-workers.
  • C, C++, and Go authors looking write scathing articles about how Rust isn't actually memory safe.
  • IOCCC winners with an interest in Rust

TST's benefits:

  • no unsafe code
  • no file access to /proc/self/mem
  • pure rust implementation
  • gluten free, vegan
  • no dependencies
  • it would compile on stable if I knew how to use doc_include
  • available on windows, linux, and select Samsung 4-Door Smart Refrigerators
  • rated R for violence and language
  • probably no_std compatible

For exotic use cases (such as FFI (just RIIR (lol))), or, if you just want to peel back the curtain, see safe!.

robot testimonial

Proof there is no unsafe:


$ grep unsafe
src/lib.rs
1:#![forbid(unsafe_code)]

safe/src/lib.rs
1:#![forbid(unsafe_code)]

$ cargo geiger
   Compiling safe v0.1.0 (/Users/jschmidt/totally-speedy-transmute/safe)
    Checking totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
    Finished dev [unoptimized + debuginfo] target(s) in 1.36s
    Scanning done

Metric output format: x/y
    x = unsafe code used by the build
    y = total unsafe code found in the crate

Symbols:
    🔒  = No `unsafe` usage found, declares #![forbid(unsafe_code)]
    ❓  = No `unsafe` usage found, missing #![forbid(unsafe_code)]
    ☢️   = `unsafe` usage found

Functions  Expressions  Impls  Traits  Methods  Dependency

0/0        0/0          0/0    0/0     0/0      🔒 totally-speedy-transmute 0.1.0
0/0        0/0          0/0    0/0     0/0      🔒 └── safe 0.1.0

0/0        0/0          0/0    0/0     0/0

$ cargo t
   Compiling totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
    Finished test [unoptimized + debuginfo] target(s) in 0.26s
     Running unittests (target/debug/deps/totally_speedy_transmute-c545620424772de5)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/wat.rs (target/debug/deps/wat-527d75fb46642aee)

running 5 tests
test leek ... ok
test fast_vec ... ok
test oops_all_mutable ... ok
test safe ... ok
test transmute_u8 ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests totally-speedy-transmute

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


$ cargo t --release
   Compiling totally-speedy-transmute v0.1.0 (/Users/jschmidt/totally-speedy-transmute)
    Finished release [optimized] target(s) in 0.28s
     Running unittests (target/release/deps/totally_speedy_transmute-5a097808724739b1)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/wat.rs (target/release/deps/wat-20a81a817034b78e)

running 5 tests
test leek ... ok
test fast_vec ... ok
test transmute_u8 ... ok
test safe ... ok
test oops_all_mutable ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests totally-speedy-transmute

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

$ pushd ~/cargo-osha/
$ cargo run -- ~/totally-speedy-transmute/**/*.rs
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/cargo-osha /Users/jschmidt/totally-speedy-transmute/safe/src/lib.rs /Users/jschmidt/totally-speedy-transmute/src/lib.rs /Users/jschmidt/totally-speedy-transmute/tests/wat.rs`
Processing file /Users/jschmidt/totally-speedy-transmute/safe/src/lib.rs
Processing file /Users/jschmidt/totally-speedy-transmute/src/lib.rs
Processing file /Users/jschmidt/totally-speedy-transmute/tests/wat.rs
Unsafe functions: 0/10
Unsafe expressions: 0/42
Unsafe traits: 0/0
Unsafe methods: 0/0
Unsafe impls: 0/0

$ poopd
fish: Unknown command: poopd

$ popd
You might also like...
A simple, stable and thread-safe implementation of a lazy value

Laizy Laizy is a Rust library that provides a simple, stable and thread-safe implementation of a Lazy Features Name Description Dependencies nightly A

A safe wrapper around Gamercade's raw Api.

gamercade-rs A safe wrapper around Gamercade's Raw Api. As the Raw Api requires using a lot of unsafe and hiding of values through different types (fo

Safe API to embed an ECMAScript engine.

Kopi Kopi is a small abstraction to easily and safely embed an ECMAScript runtime inside a Rust based application. It uses the V8 execution engine to

dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle!

dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle (such as rewriting/refactroing your DM code).

Damavand is a quantum circuit simulator. It can  run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.
Damavand is a quantum circuit simulator. It can run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.

Damavand is a quantum circuit simulator. It can run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.

Cloud-Based Microservice Performance Profiling Tool

Revelio Systems Revelio Systems is a student startup sponsored by UT Austin's Inventors Program in partnership with Trend Micro. Team: Tejas Saboo, So

Simple benchmark to compare different Kafka clients performance with similar configuration.

Kafka Producer Benchmark Simple benchmark to compare different clients performance against similar configuration. The project is relatively low tech a

Small and simple stateful applications, designed to facilitate the monitoring of unwanted behaviors of the same.

Violet Violet é um pequeno e simples monitorador de aplicação, voltado para receber eventos de erro e estado. Instalação simples: Dependencias: Docker

Small project that try to bend to world.

Small project that try to bend to world. May not be fully working, but should provide an improvable starting point. How to The only important file is

Owner
John Schmidt
John Schmidt
A little bit fast and modern Ruby version manager written in Rust

A little bit fast and modern Ruby version manager written in Rust Features Pure Rust implementation not using ruby-build Cross-platform support (macOS

Takayuki Maeda 510 Jan 5, 2023
Solidity-Compiler Version Manager

Solidity Compiler Version Manager

Rohit Narurkar 114 Jan 2, 2023
Fast and simple PHP version manager written in rust

[WIP] phpup (PHP-up): Fast and Simple PHP version manager ⚡ Fast and simple PHP version manager, written in rust Features No requirements for system P

null 27 Dec 25, 2022
A Rust driver for the Arm Generic Interrupt Controller version 3 or 4 (GICv3 and GICv4).

Arm Generic Interrupt Controller driver This crate provides a Rust driver for the Arm Generic Interrupt Controller version 3 or 4 (GICv3 and GICv4). C

Google 7 Apr 17, 2023
A transpiler/compiler for CrabRave, a version of BrainFuck with sea-life emojis.

CrabRave Programming Language CrabRave is a fun and unique programming language based on Brainfuck, which utilizes crab and sea-life emojis as its syn

null 23 May 3, 2023
A rust-version of NVIDIA BlueField DOCA kit.

Rust-DOCA Rust API wrapper for the NVIDIA DOCA SDK. The NVIDIA DOCA SDK enables developers to rapidly create applications and services on top of NVIDI

null 4 Jun 15, 2023
Rust ABI safe code generator

CGlue offers an easy way to ABI (application binary interface) safety. Just a few annotations and your trait is ready to go!

Auri 142 Jan 2, 2023
Display strings in a safe platform-appropriate way

os_display Printing strings can be tricky. They may contain control codes that mess up the message or the whole terminal. On Unix even filenames can c

Jan Verbeek 19 Dec 19, 2022
The working code for my Safe Pay app - check out my tutorial!

Safe Pay Tutorial This repository contains the source code for my blog post Using PDAs and SPL Token in Anchor. The code contains the following: Solan

Daniel Pyrathon 39 Aug 28, 2022
Define safe interfaces to MMIO and CPU registers with ease

regi regi lets you define safe interfaces to MMIO and CPU registers with ease. License Licensed under either of Apache License, Version 2.0 or MIT lic

Valentin B. 2 Feb 10, 2022