cluFullTransmute
A more complete and extended version of data type conversion without constraint checks.
Library Features
- Casting any type A to any type B without checking the dimension of the data.
- Ability to use transmutation in constant functions.
- Possibility of delayed transmutation through contracts.
- Ability to work without the standard library
- Extended support for rust versions, this library was originally designed to support permanent transmutation in circumstances where this cannot be done.
!!! ATTENTION !!!
- When converting types without checking the size of the data, you really need to understand what you are doing.
Use
1. GenericType
/*
This example is notable because by the Rust standard it does not allow
converting common types A to B, since it cannot check their sizes,
this example solves this.
Additionally, as an example, we manipulate the Drop::drop function.
*/
use force_transmute;
;
;
2. DataTransmutContract
use DataTransmutContract;
/*
For example, we will sign a contract to convert a String to a Vec<u8>,
although this may not be exactly the case.
Contracts are needed to create more secure APIs using transmutation in
situations where it can't be proven.
*/
///
License
Copyright 2022 #UlinProject Denis Kotlyarov (Денис Котляров)
Licensed under the Apache License, Version 2.0