us-irs / spacepackets-rs Goto Github PK
View Code? Open in Web Editor NEWCCSDS and ECSS packet standards implementations
Home Page: https://egit.irs.uni-stuttgart.de/rust/spacepackets
License: Apache License 2.0
CCSDS and ECSS packet standards implementations
Home Page: https://egit.irs.uni-stuttgart.de/rust/spacepackets
License: Apache License 2.0
Hello!
I've been quite interested in a rust implementation of spacepackets and have enjoyed using your project.
I have been grokking the codebase of the Rust spacepacket implementation and noticed the use of panics in the builder methods, specifically in the const_new
and new
functions of various structs. While I understand that panics are a part of Rust's error handling mechanism and can be useful for catching exceptional cases, I have concerns regarding their usage in these particular scenarios.
First, in the UnixTimestamp
struct, the const_new
function panics if the subsec_millis
value exceeds 999. Similarly, in the PacketSequenceCtrl
struct, both the const_new
and new functions panic if the seq_count
value exceeds MAX_SEQ_COUNT. Although panics can be appropriate for handling unexpected or invalid inputs, I'm unsure whether they are the best approach in these cases. I do understand for the latter example that these panic conditions are checked before calling, so they won't panic in those cases.
const_new
and new
, common for Rust 2021 projects? Would there be preferable ways to call const_new
without requiring the caller to check the panic conditions?subsec_millis
greater than 999? Would there be cases where the value may be user-specified?Thank you,
Ethan
like i actually just wanted to say thanks
Given the timeprovider example:
let timestamp_now = TimeProvider::from_now_with_u16_days().unwrap();
One could extend the interface of ::from_now_with_u16/24_days() with an optional argument to enable little vs big endianness. Doing this manually on the ouput bytes would be rather cumbersome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.