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
§Errors
This function does not currently return errors but is async for future migration support.
Sourcepub async fn run_migrations(&self) -> Result<()>
pub async fn run_migrations(&self) -> Result<()>
Sourcepub async fn create_federation(&self, federation: &Federation) -> Result<()>
pub async fn create_federation(&self, federation: &Federation) -> Result<()>
Sourcepub async fn get_federation(
&self,
federation_id: &Uuid,
) -> Result<Option<Federation>>
pub async fn get_federation( &self, federation_id: &Uuid, ) -> Result<Option<Federation>>
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
§Errors
Returns an error if the database query fails or data parsing fails.
Sourcepub async fn update_federation(&self, federation: &Federation) -> Result<()>
pub async fn update_federation(&self, federation: &Federation) -> Result<()>
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