PollVoteRepository

Trait PollVoteRepository 

Source
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§

Source

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

Source

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

Source

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

Source

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)

Source

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,

Find all votes by an owner

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,

Delete a vote

Implementors§