This will allow users of the library to easily convert a result to a dictionary and returning it directly from web frameworks like FastAPI rather than needing to check whether it is Ok or Err.
Recommended shape:
{
"value": ...,
"error": ...
}
This may take some consideration depending on the type the Result is generic over. Typically this is a model, but could also be a list of models.
This will allow users of the library to easily convert a result to a dictionary and returning it directly from web frameworks like
FastAPI
rather than needing to check whether it isOk
orErr
.Recommended shape:
This may take some consideration depending on the type the Result is generic over. Typically this is a model, but could also be a list of models.