Skip to main content

DomainService

Trait DomainService 

Source
pub trait DomainService<Input> {
    type Output;
    type Error;

    // Required method
    fn execute(&self, input: Input) -> Result<Self::Output, Self::Error>;
}
Expand description

English:
Domain operation with owned input and implementation-selected output and error types. It supplies no transaction or retry logic. The shared receiver permits interior state; neither purity nor concurrent use is required by the trait.

日本語:
所有する入力と、実装が選ぶ出力型・エラー型を持つドメイン操作です。 トランザクションや再試行処理は提供しません。共有参照でも内部状態を持てるため、 このトレイトは純粋性や並行利用を要求しません。

Required Associated Types§

Source

type Output

English:
Result value produced when the domain operation succeeds.

日本語:
ドメイン操作が成功した際の結果値です。

Source

type Error

English:
Failure reported by the service, with no required error trait bounds.

日本語:
サービスが報告する失敗です。エラートレイトの境界は課しません。

Required Methods§

Source

fn execute(&self, input: Input) -> Result<Self::Output, Self::Error>

English:
Consumes input to perform the operation, returning its output or error. Implementations define side effects on success and failure and document any panic conditions.

日本語:
input を消費して操作を実行し、出力またはエラーを返します。 成功・失敗時の副作用とパニックの条件は各実装が定め、文書化します。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§