Comments (2)
That doesn't work the way this is implemented. The data always must be in native endianness as it's directly accessed without any conversion in between to provide the lowest possible overhead, and to compile down to efficient assembly.
Similarly the data must have the correct alignment etc for the very same reasons.
If conversions/etc are needed then you can just create e.g. iterator adapters or some other translation API that e.g. makes use of the byteorder
crate or the core
API for converting bytes of arbitrary endianness to native endianness integers/floats.
What exactly is your use-case here?
from byte-slice-cast.
👌
from byte-slice-cast.
Related Issues (8)
- Support conversion between Box<[u8]>/`Box<[f32]>` (and similarly for Vec) HOT 12
- Cannot compile on wasm32-unknown-emscripten target (debug mode) HOT 3
- Tuple support HOT 5
- Support primitive array HOT 1
- What's keeping this from being 1.0 right now? HOT 16
- Zero length slice casting HOT 3
- Add support for casting Vec<T> -> Vec<U> HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byte-slice-cast.