Skip to main content

DynRealtimeModel

Trait DynRealtimeModel 

Source
pub trait DynRealtimeModel:
    Send
    + Sync
    + 'static {
    // Required methods
    fn provider(&self) -> &ProviderId;
    fn model_id(&self) -> &ModelId;
    fn do_create_client_secret(
        &self,
        options: ClientSecretOptions,
    ) -> BoxFuture<'_, Result<ClientSecret, ProviderError>>;
    fn websocket_config(&self, token: &str, url: &Url) -> WebSocketConfig;
    fn parse_server_event(
        &self,
        raw: JsonValue,
    ) -> Result<Vec<RealtimeServerEvent>, ProviderError>;
    fn serialize_client_event(
        &self,
        event: RealtimeClientEvent,
    ) -> BoxFuture<'_, Result<JsonValue, ProviderError>>;
    fn build_session_config(
        &self,
        config: &RealtimeSessionConfig,
    ) -> Result<JsonValue, ProviderError>;
    fn health_check_response(&self, raw: &JsonValue) -> Option<JsonValue>;
}
Expand description

Object-safe counterpart of RealtimeModel.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§