forked from momentohq/client-sdk-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dictionary fetch support to the Rust SDK (momentohq#82)
Adds support for the dictionary fetch command to the Rust SDK. * Update src/simple_cache_client.rs * fix test
- Loading branch information
Showing
3 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::collections::HashMap; | ||
|
||
/// Encapsulates the status of a cache disctionary get operation. | ||
#[derive(Debug)] | ||
pub enum MomentoDictionaryFetchStatus { | ||
/// Status if the dictionary was found | ||
FOUND, | ||
/// Status if the dictionary was missing | ||
MISSING, | ||
ERROR, | ||
} | ||
|
||
/// Response for a cache get operation. | ||
#[derive(Debug)] | ||
pub struct MomentoDictionaryFetchResponse { | ||
/// The result of a cache dictionary get operation. | ||
pub result: MomentoDictionaryFetchStatus, | ||
/// The dictionary contents if it was found. | ||
pub dictionary: Option<HashMap<Vec<u8>, Vec<u8>>>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters