DiagnosticManager

Trait DiagnosticManager 

Source
pub trait DiagnosticManager:
    Environment
    + Send
    + Sync {
    // Required methods
    fn SetDiagnostics<'life0, 'async_trait>(
        &'life0 self,
        Owner: String,
        EntriesDTOValue: Value,
    ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn ClearDiagnostics<'life0, 'async_trait>(
        &'life0 self,
        Owner: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn GetAllDiagnostics<'life0, 'async_trait>(
        &'life0 self,
        ResourceURIFilterOption: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An abstract service contract for an environment component that can manage diagnostic collections.

Diagnostics are problems detected in the workspace, such as compiler errors or linter warnings. They are typically owned by a source (e.g., a “typescript-linter”) and associated with specific resource URIs.

Required Methods§

Source

fn SetDiagnostics<'life0, 'async_trait>( &'life0 self, Owner: String, EntriesDTOValue: Value, ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sets or updates diagnostics for multiple resources from a specific owner.

§Parameters
  • Owner: A string identifying the source of the diagnostics (e.g., “cocoon-diag-0-typescript”).
  • EntriesDTOValue: A serde_json::Value that deserializes into an array of tuples. Each tuple has the shape [UriComponentsDTO, Option<Vec<MarkerDataDTO>>]. To clear diagnostics for a resource, provide None or an empty vector for its entry.
Source

fn ClearDiagnostics<'life0, 'async_trait>( &'life0 self, Owner: String, ) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clears all diagnostics that were previously reported by a specific owner.

§Parameters
  • Owner: The identifier of the diagnostic source to clear.
Source

fn GetAllDiagnostics<'life0, 'async_trait>( &'life0 self, ResourceURIFilterOption: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all diagnostics currently in the system, with an option to filter by a specific resource URI.

§Parameters
  • ResourceURIFilterOption: An optional serde_json::Value representing a UriComponents DTO. If Some, only diagnostics for that specific URI are returned. If None, all diagnostics are returned.
§Returns

A serde_json::Value representing an array of tuples: Vec<[UriComponentsDTO, Vec<MarkerDataDTO>]>.

Implementors§