ma_core/interfaces.rs
1//! Trait interfaces for pluggable DID and IPFS publishing backends.
2//!
3//! Implement these traits to decouple domain logic from a specific
4//! transport or storage backend.
5
6pub trait DidPublisher {
7 type Error;
8
9 fn publish_did_document(
10 &self,
11 actor_id: &str,
12 document_json: &str,
13 ) -> Result<String, Self::Error>;
14}
15
16pub trait IpfsPublisher {
17 type Error;
18
19 fn put_json(&self, value_json: &str) -> Result<String, Self::Error>;
20 fn publish_name(&self, key_name: &str, cid: &str) -> Result<String, Self::Error>;
21}