pub struct SyncEngine { /* private fields */ }Expand description
Orchestrates sync adapters for a specific guild/project scope.
Implementations§
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn new(pool: PgPool, guild_id: String, project_id: String) -> Self
pub fn new(pool: PgPool, guild_id: String, project_id: String) -> Self
Create a new sync engine scoped to a guild and project.
Sourcepub fn register(&mut self, adapter: Arc<dyn SyncAdapter>)
pub fn register(&mut self, adapter: Arc<dyn SyncAdapter>)
Register a sync adapter. Overwrites any existing adapter for the same provider name.
Sourcepub fn adapter_count(&self) -> usize
pub fn adapter_count(&self) -> usize
Returns the number of registered adapters.
Sourcepub fn project_id(&self) -> &str
pub fn project_id(&self) -> &str
Returns the project ID this engine is scoped to.
Sourcepub async fn sync_all(
&self,
events: &[SsotEvent],
) -> Result<Vec<SyncResult>, SdkError>
pub async fn sync_all( &self, events: &[SsotEvent], ) -> Result<Vec<SyncResult>, SdkError>
Run a full sync cycle across all registered adapters concurrently.
Pulls from each provider, then pushes the given outbound events. Returns aggregated results. Partial success is supported — if some adapters fail, successful results are still returned.
Sourcepub async fn sync_provider(
&self,
provider: &str,
events: &[SsotEvent],
) -> Result<Vec<SyncResult>, SdkError>
pub async fn sync_provider( &self, provider: &str, events: &[SsotEvent], ) -> Result<Vec<SyncResult>, SdkError>
Run a sync cycle for a single provider with the given events.
Auto Trait Implementations§
impl Freeze for SyncEngine
impl !RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnsafeUnpin for SyncEngine
impl !UnwindSafe for SyncEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more