Mercurial > crates > nonstick
comparison src/lib.rs @ 74:c7c596e6388f
Make conversations type-safe (last big reorg) (REAL) (NOT CLICKBAIT)
In previous versions of Conversation, you could send messages and then
return messages of the wrong type or in the wrong order or whatever.
The receiver would then have to make sure that there were the right
number of messages and that each message was the right type.
That's annoying.
This change makes the `Message` enum a two-way channel, where the asker
puts their question into it, and then the answerer (the conversation)
puts the answer in and returns control to the asker. The asker then
only has to pull the Answer of the type they wanted out of the message.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Fri, 06 Jun 2025 22:21:17 -0400 |
parents | ac6881304c78 |
children | c30811b4afae |
comparison
equal
deleted
inserted
replaced
73:ac6881304c78 | 74:c7c596e6388f |
---|---|
24 | 24 |
25 // Temporary until everything is fully wired up. | 25 // Temporary until everything is fully wired up. |
26 #![allow(dead_code)] | 26 #![allow(dead_code)] |
27 | 27 |
28 pub mod constants; | 28 pub mod constants; |
29 mod conv; | 29 pub mod conv; |
30 pub mod module; | 30 pub mod module; |
31 | 31 |
32 pub mod handle; | 32 pub mod handle; |
33 | |
34 #[cfg(feature = "link")] | |
33 mod pam_ffi; | 35 mod pam_ffi; |
34 | 36 |
37 #[cfg(feature = "link")] | |
38 pub use crate::pam_ffi::{LibPamHandle, OwnedLibPamHandle}; | |
35 #[doc(inline)] | 39 #[doc(inline)] |
36 pub use crate::{ | 40 pub use crate::{ |
37 constants::{ErrorCode, Flags, Result}, | 41 constants::{ErrorCode, Flags, Result}, |
38 conv::{Conversation, ConversationMux, DemuxedConversation, Response}, | 42 conv::{BinaryData, Conversation, SimpleConversation}, |
39 handle::{PamHandleApplication, PamHandleModule, PamShared}, | 43 handle::{PamHandleApplication, PamHandleModule, PamShared}, |
40 module::PamModule, | 44 module::PamModule, |
41 pam_ffi::{LibPamHandle, OwnedLibPamHandle}, | |
42 }; | 45 }; |