Skip to main content

EndpointResolver

Trait EndpointResolver 

Source
pub trait EndpointResolver: Send + Sync {
    // Required methods
    fn current_endpoint(&self) -> String;
    fn is_available(&self) -> bool;
    fn switching_behavior(&self) -> SwitchingBehavior;
}
Expand description

動的にエンドポイントを解決する trait

Required Methods§

Source

fn current_endpoint(&self) -> String

現在リクエストを送るべきエンドポイントを取得

状態に応じて適切なサーバーを返す(Starting 時は旧、Releasing 時は新)

Source

fn is_available(&self) -> bool

サーバーが利用可能かどうか

Active, Starting, Releasing のいずれかであれば true(リクエスト処理可能)

Source

fn switching_behavior(&self) -> SwitchingBehavior

切り替え中の挙動を取得

Implementors§