pub struct FederationDatabase { /* private fields */ }Expand description
Database layer for federation persistence
Implementations§
Source§impl FederationDatabase
impl FederationDatabase
Sourcepub async fn new(pool: SqlitePool) -> Result<Self>
pub async fn new(pool: SqlitePool) -> Result<Self>
Create a new federation database instance
Sourcepub async fn run_migrations(&self) -> Result<()>
pub async fn run_migrations(&self) -> Result<()>
Run migrations manually
Sourcepub async fn create_federation(&self, federation: &Federation) -> Result<()>
pub async fn create_federation(&self, federation: &Federation) -> Result<()>
Create a new federation
Sourcepub async fn get_federation(
&self,
federation_id: &Uuid,
) -> Result<Option<Federation>>
pub async fn get_federation( &self, federation_id: &Uuid, ) -> Result<Option<Federation>>
Get a federation by ID
Sourcepub async fn list_federations(&self, org_id: &Uuid) -> Result<Vec<Federation>>
pub async fn list_federations(&self, org_id: &Uuid) -> Result<Vec<Federation>>
List all federations for an organization
Sourcepub async fn update_federation(&self, federation: &Federation) -> Result<()>
pub async fn update_federation(&self, federation: &Federation) -> Result<()>
Update a federation
Sourcepub async fn delete_federation(&self, federation_id: &Uuid) -> Result<()>
pub async fn delete_federation(&self, federation_id: &Uuid) -> Result<()>
Delete a federation
Auto Trait Implementations§
impl Freeze for FederationDatabase
impl !RefUnwindSafe for FederationDatabase
impl Send for FederationDatabase
impl Sync for FederationDatabase
impl Unpin for FederationDatabase
impl UnsafeUnpin for FederationDatabase
impl !UnwindSafe for FederationDatabase
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