[−][src]Struct automate::sharding::ShardManager
Helps setting up a bot with multiple shards.
Using this struct is probably not necessary and Automate::launch will do the work. The only reason to use this instead of Automate::launch would be if you want to spread the shards across multiple servers or if you wanted to have more or less shards than the amount recommended by Discord.
Implementations
impl ShardManager
[src]
pub async fn with_config(config: Configuration) -> Result<ShardManager, Error>
[src]
Creates a shard manager where all the shards will use the given config.
pub fn setup(&mut self, shard_id: u32)
[src]
pub fn auto_setup(&mut self) -> &mut Self
[src]
Sets up as many shards as Discord recommends.
pub async fn launch<'_>(&'_ mut self)
[src]
Launches all the previously set up shards
pub fn recommended_shards(&self) -> u32
[src]
The amount of shards recommended by discord
pub fn total_shards(&self) -> u32
[src]
The amount of shards this bot will have. Defaults to the recommended shards value.
pub fn set_total_shards(&mut self, total_shards: u32) -> &mut Self
[src]
Sets the amount of shards the bot will have.
Auto Trait Implementations
impl !RefUnwindSafe for ShardManager
impl Send for ShardManager
impl !Sync for ShardManager
impl Unpin for ShardManager
impl !UnwindSafe for ShardManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,