Currently the basic design of Sodium assumes that anything sent through a Stream is Cloneable. In addition, to support a hypothetical multi-threaded processing algorithm, Stream values also need to be 'static + Send + Sync.
This is hefty requirement that some types don't meet, including some types that users are very likely to want to send through Streams such as std::io::Error. This has no Clone impl, which in turn means that an io::Result<T>also has no Clone impl regardless of whether T: Clone. Upon encountering a type like this, the user has two courses of action, either deal with this type outside of the Sodium system (encouraging them to put logic into their imperative shell); or find some way to make this object Clone which basically means wrapping it an Arc.
This is a papercut, and it's probably not completely obvious how to solve this for the new user.
Currently the basic design of Sodium assumes that anything sent through a
Stream
isCloneable
. In addition, to support a hypothetical multi-threaded processing algorithm,Stream
values also need to be'static + Send + Sync
.This is hefty requirement that some types don't meet, including some types that users are very likely to want to send through
Streams
such asstd::io::Error
. This has noClone
impl, which in turn means that anio::Result<T>
also has noClone
impl regardless of whetherT: Clone
. Upon encountering a type like this, the user has two courses of action, either deal with this type outside of the Sodium system (encouraging them to put logic into their imperative shell); or find some way to make this objectClone
which basically means wrapping it anArc
.This is a papercut, and it's probably not completely obvious how to solve this for the new user.