listings.rs (925B)
1 //! Initial public listing commands through the shared protected execution owner. 2 use crate::{Client, CommandContext, OperationReceipt}; 3 pub use radroots_domain::listing::Listing; 4 pub use radroots_protocol::listing::PublishInput; 5 6 /// Borrowed public-listing access. Construction performs no host effects. 7 pub struct Listings<'a> { 8 client: &'a Client, 9 } 10 impl<'a> Listings<'a> { 11 pub(crate) const fn new(client: &'a Client) -> Self { 12 Self { client } 13 } 14 /// Publishes an initial coordinate through actual T0/T1/S/T2/D. Current 15 /// seller authority is required; another publish cannot act as an edit. 16 pub async fn publish( 17 &self, 18 context: CommandContext, 19 input: PublishInput, 20 ) -> crate::ExecutionResult<OperationReceipt<Listing>> { 21 self.client 22 .session 23 .publish_listing(self.client.journal()?, context, input) 24 .await 25 } 26 }