Can I determine the zero value of generic types?
The closest I managed to find was the std::num::Int and std::num::Float traits, which define zero(). However, they are specific to primitive types.
No, because it doesn't make sense in general. In fact, there are several types where "zero" is very specifically not valid at all. For example, if you were to take an appropriately-sized zero value and transmute it into a Box, that would violate memory safety! There's an alternative to "zero", which is the Default trait. It allows you to say Default::default() to get a type's "default" value, whatever that happens to be. However, there's no consistent, sensible definition of "default" for all types. As such, you can only use it for types which explicitly implement it.
Casting away lifetime constraints?
Re-using a range for iteration
How to convert DateTime<UTC> to DateTime<FixedOffset> or vice versa?
Redefine trait for infix operators
Result has no method called “unwrap()”?
Wrapping a Rust struct in a C++ class
How to create a String directly?
Acessing data from a global struct, gives error “borrowed value does not live long enough”
captured variable does not outlive the enclosing closure [duplicate]
PI constant is ambiguous
Calling an impl method from another impl method
compilation of openssl-sys fails with `openssl/hmac.h: No such file or directory`
Indexing a String
Importing mio::tcp::TcpStream but get std::net::tcp::TcpStream
It is possible to always have Cargo show warnings?
Copy files to the target directory after build