-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace IdbCursorDirection with custom Direction enum in public API
- Loading branch information
1 parent
248555e
commit a95438e
Showing
6 changed files
with
38 additions
and
19 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
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,21 @@ | ||
use web_sys::IdbCursorDirection; | ||
|
||
/// Direction in which the key-value paris are fetched from the store. | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
pub enum Direction { | ||
Next, | ||
NextUnique, | ||
Prev, | ||
PrevUnique, | ||
} | ||
|
||
impl From<Direction> for IdbCursorDirection { | ||
fn from(direction: Direction) -> Self { | ||
match direction { | ||
Direction::Next => IdbCursorDirection::Next, | ||
Direction::NextUnique => IdbCursorDirection::Nextunique, | ||
Direction::Prev => IdbCursorDirection::Prev, | ||
Direction::PrevUnique => IdbCursorDirection::Prevunique, | ||
} | ||
} | ||
} |
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
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