@@ -197,41 +197,45 @@ follows:
1971971 . ** Implement a Trait:** In ` Mountain/Source/Environment/ ` , provide the
198198 concrete implementation for a ` Common ` trait.
199199
200- ``` rust
201- // In Mountain/Source/Environment/FileSystemProvider.rs
202-
203- use Common :: FileSystem :: {FileSystemReader , FileSystemWriter };
204-
205- #[async_trait]
206- impl FileSystemReader for MountainEnvironment {
207- async fn ReadFile (& self , Path : & PathBuf ) -> Result <Vec <u8 >, CommonError > {
208- // ... actual `tokio::fs` call ...
209-
200+ ```rust
201+
202+ // In Mountain/Source/Environment/FileSystemProvider.rs
203+
204+ use Common::FileSystem::{FileSystemReader, FileSystemWriter};
205+
206+ #[async_trait]
207+ impl FileSystemReader for MountainEnvironment {
208+ async fn ReadFile(&self, Path: &PathBuf) -> Result<Vec<u8>, CommonError> {
209+
210+ // ... actual ` tokio::fs ` call ...
211+
212+ }
213+
214+ // ...
215+
210216 }
211- // ...
212-
213- }
214- ```
217+ ```
215218
2162192 . ** Create and Execute an Effect:** In business logic, create and run an
217220 effect.
218221
219- ```rust
220- // In a Mountain service or command
221-
222- use Common :: FileSystem ;
223- use Common :: Effect :: ApplicationRunTime ;
222+ ```rust
223+
224+ // In a Mountain service or command
225+
226+ use Common::FileSystem;
227+ use Common::Effect::ApplicationRunTime;
224228
225- async fn some_logic (runtime : Arc <impl ApplicationRunTime >) {
226- let path = PathBuf :: from (" /my/file.txt" );
227- let read_effect = FileSystem :: ReadFile (path );
229+ async fn some_logic(runtime: Arc<impl ApplicationRunTime>) {
230+ let path = PathBuf::from("/my/file.txt");
231+ let read_effect = FileSystem::ReadFile(path);
228232
229- match runtime . Run (read_effect ). await {
230- Ok (content ) => info! (" File content length: {}" , content . len ()),
231- Err (e ) => error! (" Failed to read file: {:?}" , e ),
233+ match runtime.Run(read_effect).await {
234+ Ok(content) => info!("File content length: {}", content.len()),
235+ Err(e) => error!("Failed to read file: {:?}", e),
236+ }
232237 }
233- }
234- ```
238+ ```
235239
236240---
237241
0 commit comments