pub struct CollectorBuilder<T: Collectable, M = Stream> { /* private fields */ }Expand description
Configures a collector; made by the extension methods (component_collector,
await_messages, …) and the Context methods taking IDs.
T is what the collector yields; M is what the builder makes
(mode::Stream: build a Collector; mode::First and
mode::All: .await the builder). The collector is registered when it is built or
awaited, not before.
discord.js counterpart: the collector options (CollectorOptions,
MessageCollectorOptions, ReactionCollectorOptions, InteractionCollectorOptions).
Implementations§
Source§impl<T: Collectable, M> CollectorBuilder<T, M>
impl<T: Collectable, M> CollectorBuilder<T, M>
Sourcepub const fn time(self, time: Duration) -> Self
pub const fn time(self, time: Duration) -> Self
Ends the collector after time (discord.js: time).
Sourcepub const fn idle(self, idle: Duration) -> Self
pub const fn idle(self, idle: Duration) -> Self
Ends the collector when nothing was collected for idle (discord.js: idle).
Sourcepub const fn max(self, max: usize) -> Self
pub const fn max(self, max: usize) -> Self
Ends the collector after collecting max items (discord.js: max). For reactions
with dispose, a removal gives its place back, as in discord.js.
Sourcepub const fn max_processed(self, max: usize) -> Self
pub const fn max_processed(self, max: usize) -> Self
Ends the collector after max items arrived, whether the
filter accepted them or not (discord.js: maxProcessed).
Source§impl<M> CollectorBuilder<ComponentInteraction, M>
impl<M> CollectorBuilder<ComponentInteraction, M>
Sourcepub const fn component_type(self, kind: ComponentType) -> Self
pub const fn component_type(self, kind: ComponentType) -> Self
Collects only components of this type (discord.js: componentType); others are
ignored, not even processed.
Source§impl<M> CollectorBuilder<ReactionEvent, M>
impl<M> CollectorBuilder<ReactionEvent, M>
Sourcepub const fn dispose(self, dispose: bool) -> Self
pub const fn dispose(self, dispose: bool) -> Self
Also yields the removal of collected reactions (ReactionEvent::Removed,
ReactionEvent::RemovedAll; discord.js: dispose).
Sourcepub const fn max_users(self, max: usize) -> Self
pub const fn max_users(self, max: usize) -> Self
Ends the collector when max different users were collected (discord.js:
maxUsers).
Sourcepub const fn max_emojis(self, max: usize) -> Self
pub const fn max_emojis(self, max: usize) -> Self
Ends the collector when max different emojis were collected (discord.js:
maxEmojis).
Source§impl<T: Collectable> CollectorBuilder<T, Stream>
impl<T: Collectable> CollectorBuilder<T, Stream>
Trait Implementations§
Source§impl<T: Collectable, M> Debug for CollectorBuilder<T, M>
impl<T: Collectable, M> Debug for CollectorBuilder<T, M>
Source§impl<T: Collectable> IntoFuture for CollectorBuilder<T, First>
impl<T: Collectable> IntoFuture for CollectorBuilder<T, First>
Source§type Output = Result<T, CollectorError>
type Output = Result<T, CollectorError>
Source§type IntoFuture = AwaitFirst<T>
type IntoFuture = AwaitFirst<T>
Source§fn into_future(self) -> AwaitFirst<T> ⓘ
fn into_future(self) -> AwaitFirst<T> ⓘ
Source§impl IntoFuture for CollectorBuilder<Arc<MessageCreate>, All>
impl IntoFuture for CollectorBuilder<Arc<MessageCreate>, All>
Source§type Output = Collected<Id<MessageMarker>, Arc<MessageCreate>>
type Output = Collected<Id<MessageMarker>, Arc<MessageCreate>>
Source§type IntoFuture = AwaitAll<Arc<MessageCreate>, Id<MessageMarker>, Arc<MessageCreate>>
type IntoFuture = AwaitAll<Arc<MessageCreate>, Id<MessageMarker>, Arc<MessageCreate>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Source§impl IntoFuture for CollectorBuilder<ReactionEvent, All>
impl IntoFuture for CollectorBuilder<ReactionEvent, All>
Source§type Output = Collected<String, CollectedReaction>
type Output = Collected<String, CollectedReaction>
Source§type IntoFuture = AwaitAll<ReactionEvent, String, CollectedReaction>
type IntoFuture = AwaitAll<ReactionEvent, String, CollectedReaction>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl<T, M = Stream> !RefUnwindSafe for CollectorBuilder<T, M>
impl<T, M = Stream> !Sync for CollectorBuilder<T, M>
impl<T, M = Stream> !UnwindSafe for CollectorBuilder<T, M>
impl<T, M> Freeze for CollectorBuilder<T, M>
impl<T, M> Send for CollectorBuilder<T, M>
impl<T, M> Unpin for CollectorBuilder<T, M>
impl<T, M> UnsafeUnpin for CollectorBuilder<T, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more