Struct serenity_rich_interaction::menu::MenuBuilder
source · [−]pub struct MenuBuilder { /* private fields */ }
Expand description
A builder for messages
Implementations
sourceimpl MenuBuilder
impl MenuBuilder
sourcepub fn new_paginator() -> Self
pub fn new_paginator() -> Self
Creates a new pagination menu
sourcepub fn add_pages<I>(self, pages: I) -> Self where
I: IntoIterator<Item = Page<'static>>,
pub fn add_pages<I>(self, pages: I) -> Self where
I: IntoIterator<Item = Page<'static>>,
Adds multiple pages to the message
sourcepub fn add_control<S, F: 'static>(
self,
position: isize,
emoji: S,
action: F
) -> Self where
S: ToString,
F: for<'b> Fn(&'b Context, &'b mut Menu<'_>, Reaction) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'b>> + Send + Sync,
pub fn add_control<S, F: 'static>(
self,
position: isize,
emoji: S,
action: F
) -> Self where
S: ToString,
F: for<'b> Fn(&'b Context, &'b mut Menu<'_>, Reaction) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'b>> + Send + Sync,
Adds a single control to the message
sourcepub fn add_controls<S, I>(self, controls: I) -> Self where
S: ToString,
I: IntoIterator<Item = (isize, S, ControlActionArc)>,
pub fn add_controls<S, I>(self, controls: I) -> Self where
S: ToString,
I: IntoIterator<Item = (isize, S, ControlActionArc)>,
Adds a single control to the message
sourcepub fn start_page(self, page: usize) -> Self
pub fn start_page(self, page: usize) -> Self
Sets the start page of the message
sourcepub fn sticky(self, value: bool) -> Self
pub fn sticky(self, value: bool) -> Self
If the message should be sticky and always be the last one in the channel
sourcepub fn add_data<T>(self, value: T::Value) -> Self where
T: TypeMapKey,
pub fn add_data<T>(self, value: T::Value) -> Self where
T: TypeMapKey,
Adds data to the menu typemap
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for MenuBuilder
impl Send for MenuBuilder
impl Sync for MenuBuilder
impl Unpin for MenuBuilder
impl !UnwindSafe for MenuBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more