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§
Sourcefn current_endpoint(&self) -> String
fn current_endpoint(&self) -> String
現在リクエストを送るべきエンドポイントを取得
状態に応じて適切なサーバーを返す(Starting 時は旧、Releasing 時は新)
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
サーバーが利用可能かどうか
Active, Starting, Releasing のいずれかであれば true(リクエスト処理可能)
Sourcefn switching_behavior(&self) -> SwitchingBehavior
fn switching_behavior(&self) -> SwitchingBehavior
切り替え中の挙動を取得