mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-07 09:03:12 +00:00
31 lines
815 B
Rust
31 lines
815 B
Rust
![]() |
use crate::collab_builder::{CollabPluginProviderContext, CollabPluginProviderType};
|
||
|
use collab::preclude::CollabPlugin;
|
||
|
use lib_infra::future::Fut;
|
||
|
use std::rc::Rc;
|
||
|
use std::sync::Arc;
|
||
|
|
||
|
pub trait CollabCloudPluginProvider: 'static {
|
||
|
fn provider_type(&self) -> CollabPluginProviderType;
|
||
|
|
||
|
fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Arc<dyn CollabPlugin>>>;
|
||
|
|
||
|
fn is_sync_enabled(&self) -> bool;
|
||
|
}
|
||
|
|
||
|
impl<T> CollabCloudPluginProvider for Rc<T>
|
||
|
where
|
||
|
T: CollabCloudPluginProvider,
|
||
|
{
|
||
|
fn provider_type(&self) -> CollabPluginProviderType {
|
||
|
(**self).provider_type()
|
||
|
}
|
||
|
|
||
|
fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Arc<dyn CollabPlugin>>> {
|
||
|
(**self).get_plugins(context)
|
||
|
}
|
||
|
|
||
|
fn is_sync_enabled(&self) -> bool {
|
||
|
(**self).is_sync_enabled()
|
||
|
}
|
||
|
}
|