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
By using https://doc.rust-lang.org/core/nonzero/struct.NonZero.html and a constructor, we could make errors look like Option<Error>, while still being internally represented as a single u32, retaining binary compatibility (and thus being truly zero-overhead). Then, we could have all the svcs return an Option<Error>, giving us the ability to pattern match over its result.
TODO: Check if Result<(), Error> would be represented as a single u32 as well. If it is, then that's even better!
Right now, our errors are wrapped into a rust newtype: https://github.com/roblabla/megaton-hammer/blob/master/megaton-hammer/src/lib.rs#L56
There are several additions we should do to it:
Option<Error>
, while still being internally represented as a singleu32
, retaining binary compatibility (and thus being truly zero-overhead). Then, we could have all the svcs return anOption<Error>
, giving us the ability to pattern match over its result.Result<(), Error>
would be represented as a single u32 as well. If it is, then that's even better!The text was updated successfully, but these errors were encountered: