Comments (5)
Introducing a new trait function only for this usecase does not make much sense to me. There are two main options that I can think of:
- Return
Result
fromdeserialize_from()
. - Panic in scenarios where input is invalid.
What do you think?
from desse.
I would vote for Result, because it provides user with more control of error handling (return, panic, log, or maybe unchecked unwrap). Also, in client-server scenario bytes can come from untrusted source, and server should return error to client rather than panic.
from desse.
Yes. Result
makes more sense here.
from desse.
Closing this in favour of #13
from desse.
Since this triggers UB from safe code, could you file a security advisory at https://github.com/RustSec/advisory-db? This will let users of your crate check if they're depending on a vulnerable version and upgrade.
from desse.
Related Issues (12)
- High level design for enum support HOT 2
- Benchmark bincode serialization using serialize_into HOT 1
- Optional Default types instead of zero-initialized data? HOT 3
- Add documentation for using Desse with enums HOT 1
- Add benchmark results in README.md HOT 2
- Support for enums with unit variants HOT 1
- API design for Version Tolerant Serialization
- `Desse::deserialize_from()` should return a `Result`
- API design for serialization and deserialization of dynamically allocated types
- Support Option<T: DesseStatic + DesseSize> HOT 3
- desse = "0.2.1" : no `DesseStatic` in the root HOT 3
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 desse.