Serde custom Derive impl (i.e. passing the value that would have been in the field/variant into a trait method that changes things in customizable way before putting the resulting modification into the field/variant instead of the original value)
No, rather serde (as an ecosystem) is basically a superset of what rkyv does, with bincode being the serde's subset more similar to rkyv. However rkyv is more specialized to what it does, and thus can do it faster.
So in the end serde provides you lot of flexibility but can be a little slower, while rkyv is much more limiting in what you can do but can do that very efficiently. As always, it's a matter of tradeoffs.
No, serde is an adapter, by itself it doesn't de/serialize, it defines an architecture de/serializers can re-use. serde separates the concerns of serialization/deserialization logic and the actual data format.
rkyv on the other hand is both the de/serializer and the format.
oh! ok how about comparing serde_json with rkyv. Can rkyv do everything that serde_json can do? I think serde_json is the actual de/serializer that uses the serde architecture, together with the format.
SkiFire already answered that. serde/bincode is what you'd compare to rkyv.
I have never used rkyv but I believe it's simply not as flexible as serde/bincode because of different goals. rkyv aims for performant deserialization. serde doesn't necessarily aim for performance, though it does achieve it.
The main question is: does your application domain need what rkyv offers? Specialized performance and zerocopy deserialization at the cost of a specialized data format (that no else can read back).
Keep in mind that you can use bothserde and rkyv in different parts of your application.
I'm currently relying heavily on advanced features in serde-json but I'm considering if replacing some of that with rkyv may be beneficial. But you said rkyv is more comparable to serde/bincode rather than serde/json so perhaps rkyv isn't a viable replacement for serde_json
To me it would seem obvious you can't blindly swap JSON with rkyv. The two aren't used in the same contexts. JSON is used to communicate between machines, generally over HTTP APIs, sometimes for human readable configuration files, rkyv would be used for game dev asset loading, state serializing, maybe database servers.