From e4ad766315879e1ff05bb111229f073f8f0ed68e Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Mon, 10 Oct 2022 21:30:02 +0200 Subject: PassFish: Initial Commit Well, that's a lie. But nobody needs to see all the iterations I decided to sweep under the rug. That said, I think the repo is, while not clean, clean enough now, to not be embarrassed by uploading it to github. --- .../passwordmaker/thread_messages.rs | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 rust/src/implementation/passwordmaker/thread_messages.rs (limited to 'rust/src/implementation/passwordmaker/thread_messages.rs') diff --git a/rust/src/implementation/passwordmaker/thread_messages.rs b/rust/src/implementation/passwordmaker/thread_messages.rs new file mode 100644 index 0000000..bba3dfa --- /dev/null +++ b/rust/src/implementation/passwordmaker/thread_messages.rs @@ -0,0 +1,41 @@ +use std::sync::Arc; +use passwordmaker_rs::{GenerationError,SettingsError}; +use crate::implementation::profiles::GenerationSettings; + +pub(super) enum HelperToUi { + Generated { + password : String, + }, + GenerationFailed { + error : GenerationIssue + }, + GenerationStarted +} + +pub(super) struct GeneratePasswordTask{ + pub(crate) input : String, + pub(crate) master_password : String, + pub(crate) generation_settings : Arc +} + +pub(super) enum UiToHelper { + Shutdown, + GeneratePassword(GeneratePasswordTask), +} + +pub(super) enum GenerationIssue { + Settings(SettingsError), + Input(GenerationError), +} + +impl From for GenerationIssue { + fn from(s: SettingsError) -> Self { + GenerationIssue::Settings(s) + } +} + +impl From for GenerationIssue { + fn from(g: GenerationError) -> Self { + GenerationIssue::Input(g) + } +} \ No newline at end of file -- cgit v1.2.3