Struct twitch_api::helix::polls::CreatePollBody
source · [−]#[non_exhaustive]pub struct CreatePollBody<'a> {
pub broadcaster_id: Cow<'a, UserIdRef>,
pub title: Cow<'a, str>,
pub duration: i64,
pub choices: Cow<'a, [NewPollChoice<'a>]>,
pub bits_voting_enabled: Option<bool>,
pub bits_per_vote: Option<i64>,
pub channel_points_voting_enabled: Option<bool>,
pub channel_points_per_vote: Option<i64>,
}
helix
only.Expand description
Body Parameters for Create Poll
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.broadcaster_id: Cow<'a, UserIdRef>
The broadcaster running polls. Provided broadcaster_id must match the user_id in the user OAuth token.
title: Cow<'a, str>
Question displayed for the poll. Maximum: 60 characters.
duration: i64
Total duration for the poll (in seconds). Minimum: 15. Maximum: 1800.
choices: Cow<'a, [NewPollChoice<'a>]>
Array of the poll choices. Minimum: 2 choices. Maximum: 5 choices.
bits_voting_enabled: Option<bool>
Indicates if Bits can be used for voting. Default: false
bits_per_vote: Option<i64>
Number of Bits required to vote once with Bits. Minimum: 0. Maximum: 10000.
channel_points_voting_enabled: Option<bool>
Indicates if Channel Points can be used for voting. Default: false
channel_points_per_vote: Option<i64>
Number of Channel Points required to vote once with Channel Points. Minimum: 0. Maximum: 1000000.
Implementations
sourceimpl<'a> CreatePollBody<'a>
impl<'a> CreatePollBody<'a>
sourcepub fn builder() -> CreatePollBodyBuilder<'a, ((), (), (), (), (), (), (), ())>
pub fn builder() -> CreatePollBodyBuilder<'a, ((), (), (), (), (), (), (), ())>
Create a builder for building CreatePollBody
.
On the builder, call .broadcaster_id(...)
, .title(...)
, .duration(...)
, .choices(...)
(optional), .bits_voting_enabled(...)
(optional), .bits_per_vote(...)
(optional), .channel_points_voting_enabled(...)
(optional), .channel_points_per_vote(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of CreatePollBody
.
sourceimpl<'a> CreatePollBody<'a>
impl<'a> CreatePollBody<'a>
sourcepub fn channel_points_voting_enabled(self, enabled: bool) -> Self
pub fn channel_points_voting_enabled(self, enabled: bool) -> Self
Set if Channel Points voting is enabled
sourcepub fn channel_points_per_vote(self, points: i64) -> Self
pub fn channel_points_per_vote(self, points: i64) -> Self
Channel points per vote
Trait Implementations
sourceimpl<'a> Clone for CreatePollBody<'a>
impl<'a> Clone for CreatePollBody<'a>
sourcefn clone(&self) -> CreatePollBody<'a>
fn clone(&self) -> CreatePollBody<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a> Debug for CreatePollBody<'a>
impl<'a> Debug for CreatePollBody<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for CreatePollBody<'a>
impl<'de: 'a, 'a> Deserialize<'de> for CreatePollBody<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl<'a> PartialEq<CreatePollBody<'a>> for CreatePollBody<'a>
impl<'a> PartialEq<CreatePollBody<'a>> for CreatePollBody<'a>
sourcefn eq(&self, other: &CreatePollBody<'a>) -> bool
fn eq(&self, other: &CreatePollBody<'a>) -> bool
sourceimpl<'a> Serialize for CreatePollBody<'a>
impl<'a> Serialize for CreatePollBody<'a>
impl<'a> Eq for CreatePollBody<'a>
impl<'a> StructuralEq for CreatePollBody<'a>
impl<'a> StructuralPartialEq for CreatePollBody<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for CreatePollBody<'a>
impl<'a> Send for CreatePollBody<'a>
impl<'a> Sync for CreatePollBody<'a>
impl<'a> Unpin for CreatePollBody<'a>
impl<'a> UnwindSafe for CreatePollBody<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.sourceimpl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
impl<T> HelixRequestBody for Twhere
T: Serialize + SealedSerialize,
sourcefn try_to_body(&self) -> Result<Bytes, BodyError>
fn try_to_body(&self) -> Result<Bytes, BodyError>
helix
only.