Mountain/Environment/DocumentProvider/
mod.rs1use CommonLibrary::Document::DocumentProvider::DocumentProvider;
25use async_trait::async_trait;
26
27mod OpenDocument;
29mod SaveOperations;
30mod ApplyChanges;
31mod Notifications;
32
33#[async_trait]
34impl DocumentProvider for crate::Environment::MountainEnvironment::MountainEnvironment {
35 async fn OpenDocument(
36 &self,
37 URIComponentsDTO:serde_json::Value,
38 LanguageIdentifier:Option<String>,
39 Content:Option<String>,
40 ) -> Result<url::Url, CommonLibrary::Error::CommonError::CommonError> {
41 OpenDocument::open_document(self, URIComponentsDTO, LanguageIdentifier, Content).await
42 }
43
44 async fn SaveDocument(&self, URI:url::Url) -> Result<bool, CommonLibrary::Error::CommonError::CommonError> {
45 SaveOperations::save_document(self, URI).await
46 }
47
48 async fn SaveDocumentAs(
49 &self,
50 OriginalURI:url::Url,
51 NewTargetURI:Option<url::Url>,
52 ) -> Result<Option<url::Url>, CommonLibrary::Error::CommonError::CommonError> {
53 SaveOperations::save_document_as(self, OriginalURI, NewTargetURI).await
54 }
55
56 async fn SaveAllDocuments(
57 &self,
58 IncludeUntitled:bool,
59 ) -> Result<Vec<bool>, CommonLibrary::Error::CommonError::CommonError> {
60 SaveOperations::save_all_documents(self, IncludeUntitled).await
61 }
62
63 async fn ApplyDocumentChanges(
64 &self,
65 URI:url::Url,
66 NewVersionIdentifier:i64,
67 ChangesDTOCollection:serde_json::Value,
68 _IsDirtyAfterChange:bool,
69 _IsUndoing:bool,
70 _IsRedoing:bool,
71 ) -> Result<(), CommonLibrary::Error::CommonError::CommonError> {
72 ApplyChanges::apply_document_changes(
73 self,
74 URI,
75 NewVersionIdentifier,
76 ChangesDTOCollection,
77 _IsDirtyAfterChange,
78 _IsUndoing,
79 _IsRedoing,
80 )
81 .await
82 }
83}