Struct majority::Polls

source ·
pub struct Polls { /* private fields */ }

Implementations§

source§

impl Polls

source

pub fn new<P: AsRef<Path>>(db_path: P) -> Result<Self>

source

pub fn add_poll<S1, S2, S3, S4>( &self, poll_uuid: S1, author_uuid: S2, desc: S3, options: Vec<S4> ) -> Result<Poll>where S1: Into<String>, S2: Into<String>, S3: Into<String>, S4: Into<String>,

source

pub fn add_options<S1, S2>( &self, poll_uuid: S1, options: Vec<S2> ) -> Result<Poll>where S1: Into<String>, S2: Into<String>,

source

pub fn vote<S1, S2>( &self, poll_uuid: S1, option_number: usize, user_uuid: S2, value: usize ) -> Result<Poll>where S1: Into<String>, S2: Into<String>,

source

pub fn get_poll<S: Into<String>>(&self, poll_uuid: S) -> Result<Poll>

source

pub fn is_poll_open<S: Into<String>>(&self, poll_uuid: S) -> Result<bool>

source

pub fn close_poll<S: Into<String>>(&self, poll_uuid: S) -> Result<Poll>

Auto Trait Implementations§

§

impl RefUnwindSafe for Polls

§

impl Send for Polls

§

impl Sync for Polls

§

impl Unpin for Polls

§

impl UnwindSafe for Polls

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.