You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way for a custom generic Decodable/Encodable instance (compatible with #[deriving] other) to return a new error since it's completely generic, that is,
#[deriving(Decodable)]structFoo{x:Bar}structBar{y:int}// E has to be that generic to work with the deriving above,// but this means this impl cannot manually create new errors// (e.g. if y is supposed to be an even number, there's no way// to emit "error: found odd number".)impl<E,D:Decoder<E>>Decodable<D,E>forBar{ ... }
It might be nice if there was a E: Error trait (or some such) that deriving used, which has some basic constructors.