pub struct PostgresVoteRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl VoteRepository for PostgresVoteRepository
impl VoteRepository for PostgresVoteRepository
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 Vote,
) -> Pin<Box<dyn Future<Output = Result<Vote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 Vote,
) -> Pin<Box<dyn Future<Output = Result<Vote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cast a vote on a resolution
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a vote by ID
Source§fn find_by_resolution_id<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_resolution_id<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all votes for a resolution
Source§fn find_by_owner_id<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_owner_id<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all votes by an owner (across all resolutions)
Source§fn find_by_resolution_and_unit<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_resolution_and_unit<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a vote for a specific unit on a specific resolution
Source§fn has_voted<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_voted<'life0, 'async_trait>(
&'life0 self,
resolution_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a unit has already voted on a resolution
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 Vote,
) -> Pin<Box<dyn Future<Output = Result<Vote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 Vote,
) -> Pin<Box<dyn Future<Output = Result<Vote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a vote (for changing vote choice)
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a vote
Auto Trait Implementations§
impl Freeze for PostgresVoteRepository
impl !RefUnwindSafe for PostgresVoteRepository
impl Send for PostgresVoteRepository
impl Sync for PostgresVoteRepository
impl Unpin for PostgresVoteRepository
impl !UnwindSafe for PostgresVoteRepository
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.