momentohq / client-sdk-rust

Official Rust SDK for Momento Serverless Cache
Apache License 2.0
12 stars 4 forks source link

feat: improve NotFound handling, return Optional for storage get #365

Closed cprice404 closed 4 months ago

cprice404 commented 4 months ago

This is a POC for addressing some of the things that we ran into in the other SDKs; namely:

  1. Split up NotFound errors into distinct categories
  2. Change GetResponse value to Optional, to allow us to distinguish between NotFound and WrongType

Also removes the inner Success enum value from the GetResponse because it was making it harder to work with the success case, and in the Cache client, we don't use enums when we only have a single response type.

Open to feedback on all of the above.