pub trait PollVoteRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 PollVote,
) -> Pin<Box<dyn Future<Output = Result<PollVote, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PollVote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_poll<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PollVote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_poll_and_owner<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PollVote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PollVote>, 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;
}Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 PollVote,
) -> Pin<Box<dyn Future<Output = Result<PollVote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
vote: &'life1 PollVote,
) -> Pin<Box<dyn Future<Output = Result<PollVote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new poll vote
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PollVote>, 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<PollVote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find vote by ID
Sourcefn find_by_poll<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PollVote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_poll<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PollVote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all votes for a poll
Sourcefn find_by_poll_and_owner<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PollVote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_poll_and_owner<'life0, 'async_trait>(
&'life0 self,
poll_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PollVote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find vote by poll and owner (for duplicate checking)