pub trait Policy<Context>where
Context: ?Sized,{
type Error;
// Required method
fn check(&self, context: &Context) -> Result<(), Self::Error>;
}Expand description
English: Exposes core 0.4’s domain, persistence, and event-workflow API.
日本語: コア 0.4 のドメイン、永続化、イベント処理 API を公開します。 English: Exposes typed domain operations and borrowed-context policy checks.
日本語: 型付きのドメイン操作と、コンテキストを借用するポリシー確認を公開します。 English: Fallible domain rule checked against a borrowed, possibly unsized context. Rejection and inability to evaluate are both represented by the implementation’s error type. This trait does not enforce the rule automatically at other domain boundaries.
日本語: サイズ不定でもよいコンテキストを借用して確認する、失敗し得るドメイン規則です。 拒否と評価不能は、どちらも実装のエラー型で表現します。 他のドメイン境界で規則を自動的に強制するものではありません。
Required Associated Types§
Required Methods§
Sourcefn check(&self, context: &Context) -> Result<(), Self::Error>
fn check(&self, context: &Context) -> Result<(), Self::Error>
English: Returns Ok(()) when context passes the rule, otherwise a policy error.
No ownership of the context is transferred; effects and panics depend on the implementation.
日本語: context が規則を満たす場合は Ok(())、それ以外はポリシーエラーを返します。
コンテキストの所有権は移らず、副作用とパニックは実装に依存します。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".