Skip to main content

AutoModeSwitchHandler

Trait AutoModeSwitchHandler 

Source
pub trait AutoModeSwitchHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        error_code: Option<String>,
        retry_after_seconds: Option<f64>,
    ) -> Pin<Box<dyn Future<Output = AutoModeSwitchResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler for auto_mode_switch.requested events. When unset, requestAutoModeSwitch: false goes on the wire.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, session_id: SessionId, error_code: Option<String>, retry_after_seconds: Option<f64>, ) -> Pin<Box<dyn Future<Output = AutoModeSwitchResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Decide whether to fall back to the auto model after an eligible rate-limit error. retry_after_seconds, when present, is the number of seconds until the rate limit resets.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§