Factory methods for creating Result instances.
Creates a failed result that holds error.
Creates a successful result that holds value.