-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename 'reader' API to state machine api
- Loading branch information
1 parent
c6d0980
commit 93d3518
Showing
6 changed files
with
42 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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,24 @@ | ||
macro_rules! transition { | ||
($state: expr => ($pattern: pat) $body: expr) => { | ||
$state = if let $pattern = std::mem::take(&mut $state) { | ||
$body | ||
} else { | ||
unreachable!() | ||
}; | ||
}; | ||
} | ||
|
||
mod archive; | ||
pub use archive::ArchiveReader; | ||
|
||
mod entry; | ||
|
||
/// Indicates whether or not the state machine has completed its work | ||
pub enum FsmResult<T> { | ||
/// Indicates that the state machine still has work to do, and | ||
/// needs either data or a call to process | ||
Continue, | ||
/// Indicates that the state machine has completed its work, and | ||
/// the result is the value provided | ||
Done(T), | ||
} |