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§
Sourcefn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Sourcefn do_create_client_secret(
&self,
options: ClientSecretOptions,
) -> BoxFuture<'_, Result<ClientSecret, ProviderError>>
fn do_create_client_secret( &self, options: ClientSecretOptions, ) -> BoxFuture<'_, Result<ClientSecret, ProviderError>>
Sourcefn websocket_config(&self, token: &str, url: &Url) -> WebSocketConfig
fn websocket_config(&self, token: &str, url: &Url) -> WebSocketConfig
Sourcefn parse_server_event(
&self,
raw: JsonValue,
) -> Result<Vec<RealtimeServerEvent>, ProviderError>
fn parse_server_event( &self, raw: JsonValue, ) -> Result<Vec<RealtimeServerEvent>, ProviderError>
Sourcefn serialize_client_event(
&self,
event: RealtimeClientEvent,
) -> BoxFuture<'_, Result<JsonValue, ProviderError>>
fn serialize_client_event( &self, event: RealtimeClientEvent, ) -> BoxFuture<'_, Result<JsonValue, ProviderError>>
Sourcefn build_session_config(
&self,
config: &RealtimeSessionConfig,
) -> Result<JsonValue, ProviderError>
fn build_session_config( &self, config: &RealtimeSessionConfig, ) -> Result<JsonValue, ProviderError>
Sourcefn health_check_response(&self, raw: &JsonValue) -> Option<JsonValue>
fn health_check_response(&self, raw: &JsonValue) -> Option<JsonValue>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".