safe_memory_client.rs (539B)
1 //! Builds and explicitly closes the safe in-process client. 2 3 use radroots_sdk::{ClientBuilder, capability::CapabilityId}; 4 use radroots_storage::event::SourceGeneration; 5 6 #[tokio::main] 7 async fn main() -> Result<(), Box<dyn std::error::Error>> { 8 let generation = SourceGeneration::new([1; 32])?; 9 let client = ClientBuilder::memory(generation).build()?; 10 11 assert!( 12 client 13 .capabilities() 14 .get(CapabilityId::CANONICAL_STORAGE) 15 .is_some() 16 ); 17 18 client.close().await?; 19 Ok(()) 20 }