pub trait ValidatorPort: Send + Sync {
// Required methods
fn kind(&self) -> &str;
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
proposal_content: &'life1 str,
constraints: &'life2 TaskConstraints,
) -> Pin<Box<dyn Future<Output = Result<ValidatorReport, DomainError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Required Methods§
Sourcefn kind(&self) -> &str
fn kind(&self) -> &str
Stable identifier of what this validator checks (e.g.
"lint", "policy", "clinical-safety"). Used to tag the
emitted report.
Sourcefn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
proposal_content: &'life1 str,
constraints: &'life2 TaskConstraints,
) -> Pin<Box<dyn Future<Output = Result<ValidatorReport, DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
proposal_content: &'life1 str,
constraints: &'life2 TaskConstraints,
) -> Pin<Box<dyn Future<Output = Result<ValidatorReport, DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate proposal content. The returned report’s kind must
match Self::kind.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".