pub trait ServerCommunicationConfigRepository:
Send
+ Sync
+ 'static {
type GetError: Debug + Send + Sync + 'static;
type SaveError: Debug + Send + Sync + 'static;
// Required methods
fn get(
&self,
hostname: String,
) -> impl Future<Output = Result<Option<ServerCommunicationConfig>, Self::GetError>>;
fn save(
&self,
hostname: String,
config: ServerCommunicationConfig,
) -> impl Future<Output = Result<(), Self::SaveError>>;
}Expand description
Repository for storing server communication configuration
This trait abstracts storage to allow TypeScript implementations via State Provider in WASM contexts, while also supporting in-memory implementations for testing.
Required Associated Types§
Required Methods§
Sourcefn get(
&self,
hostname: String,
) -> impl Future<Output = Result<Option<ServerCommunicationConfig>, Self::GetError>>
fn get( &self, hostname: String, ) -> impl Future<Output = Result<Option<ServerCommunicationConfig>, Self::GetError>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.