-
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.
- Loading branch information
1 parent
64a0430
commit 316e2d7
Showing
3 changed files
with
37 additions
and
3 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,26 @@ | ||
//! Events which can be emitted from this component. | ||
//! Match on the received json string to listen for these events. | ||
/// Events which can be emitted from this component. | ||
/// If the `serde` feature is enabled, these events will be serialized | ||
/// with an adjacent `tag` and `val` to match the style that wit-component uses, | ||
/// so that when this event reaches the Context Router in `wurbo`, it can be routed accordingly. | ||
/// See <https://serde.rs/enum-representations.html#adjacently-tagged> for more information. | ||
/// | ||
/// This enum is non-exhaustive, so that new events can be added in the future without breaking | ||
#[derive(Debug, Clone)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
#[cfg_attr(feature = "serde", serde(tag = "tag", content = "val"))] | ||
#[non_exhaustive] | ||
pub enum Contexts { | ||
Events(Event), | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
#[cfg_attr(feature = "serde", serde(tag = "tag", content = "val"))] | ||
#[non_exhaustive] | ||
pub enum Event { | ||
/// The encrypted seed | ||
Encrypted(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