inbox.rs (989B)
1 //! Private inquiry commands through the client's actual protected journal. 2 use crate::{Client, CommandContext, OperationReceipt}; 3 use radroots_domain::ChatMessage; 4 pub use radroots_execution::inbox::{InquireInput, ListingRevisionRef}; 5 6 /// Borrowed access to one client's inquiry execution boundary. 7 pub struct Inbox<'a> { 8 client: &'a Client, 9 } 10 impl<'a> Inbox<'a> { 11 pub(crate) const fn new(client: &'a Client) -> Self { 12 Self { client } 13 } 14 /// Durably admits an inquiry and returns its actual coherent receipt. 15 /// Pending state does not claim signing, installation or relay acceptance. 16 /// Dropping observation never rolls back an accepted native transaction. 17 pub async fn inquire( 18 &self, 19 context: CommandContext, 20 input: InquireInput, 21 ) -> crate::ExecutionResult<OperationReceipt<ChatMessage>> { 22 self.client 23 .session 24 .inquire(self.client.journal()?, context, input) 25 .await 26 } 27 }