Type Definition kernel::
type Result<T = ()> = Result<T, Error>;
To be used as the return type for functions that may fail.
In C, it is common that functions indicate success or failure through
their return value; modifying or returning extra data through non-
pointer parameters. In particular, in the kernel, functions that may fail
typically return an
int that represents a generic error code. We model
In Rust, it is idiomatic to model functions that may fail as returning
Result. Since in the kernel many functions return an error code,
Result is a type alias for a
core::result::Result that uses
Error as its error type.
Note that even if a function does not return anything when it succeeds,
it should still be modeled as returning a
Result rather than