Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository = "https://github.com/Kitt3120/lum"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-trait = "0.1.83"
dirs = "5.0.1"
downcast-rs = "1.2.0"
fern = { version = "0.6.2", features = ["chrono", "colored", "date-based"] }
Expand All @@ -23,4 +24,4 @@ serenity = { version = "0.12.0", default-features=false, features = ["builder",
sqlx = { version = "0.8.0", features = ["runtime-tokio", "any", "postgres", "mysql", "sqlite", "tls-native-tls", "migrate", "macros", "uuid", "chrono", "json"] }
thiserror = "1.0.52"
tokio = { version = "1.35.1", features = ["full"] }
uuid = { version = "1.10.0", features = ["fast-rng", "macro-diagnostics", "v4"] }
uuid = { version = "1.10.0", features = ["fast-rng", "macro-diagnostics", "v4"] }
22 changes: 7 additions & 15 deletions src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use std::{fmt::Display, sync::Arc};
use log::error;
use tokio::{signal, sync::Mutex};

use crate::service::{
types::LifetimedPinnedBoxedFuture, OverallStatus, Service, ServiceManager, ServiceManagerBuilder,
};
use crate::service::{OverallStatus, Service, ServiceManager, ServiceManagerBuilder};

#[derive(Debug, Clone, Copy)]
pub enum ExitReason {
Expand Down Expand Up @@ -68,20 +66,14 @@ impl Bot {
BotBuilder::new(name)
}

//TODO: When Rust allows async trait methods to be object-safe, refactor this to use async instead of returning a future
pub fn start(&mut self) -> LifetimedPinnedBoxedFuture<'_, ()> {
Box::pin(async move {
self.service_manager.start_services().await;
//TODO: Potential for further initialization here, like modules
})
pub async fn start(&mut self) {
self.service_manager.start_services().await;
//TODO: Potential for further initialization here, like modules
}

//TODO: When Rust allows async trait methods to be object-safe, refactor this to use async instead of returning a future
pub fn stop(&mut self) -> LifetimedPinnedBoxedFuture<'_, ()> {
Box::pin(async move {
self.service_manager.stop_services().await;
//TODO: Potential for further deinitialization here, like modules
})
pub async fn stop(&mut self) {
self.service_manager.stop_services().await;
//TODO: Potential for further deinitialization here, like modules
}

pub async fn join(&self) -> ExitReason {
Expand Down
6 changes: 2 additions & 4 deletions src/service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod discord;
// TODO: Used for downcast_rs. Maybe this can be removed when updating the crate.
#[allow(clippy::multiple_bound_locations)]
pub mod service; // Will be fixed when lum gets seperated into multiple workspaces
pub mod service_manager;
pub mod types;
Expand All @@ -9,7 +7,7 @@ pub mod watchdog;
pub use service::{Service, ServiceInfo};
pub use service_manager::{ServiceManager, ServiceManagerBuilder};
pub use types::{
BoxedError, BoxedFuture, BoxedFutureResult, OverallStatus, PinnedBoxedFuture, PinnedBoxedFutureResult,
Priority, ShutdownError, StartupError, Status,
BoxedError, LifetimedPinnedBoxedFuture, LifetimedPinnedBoxedFutureResult, OverallStatus,
PinnedBoxedFuture, PinnedBoxedFutureResult, Priority, ShutdownError, StartupError, Status,
};
pub use watchdog::Watchdog;
135 changes: 68 additions & 67 deletions src/service/discord.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use super::{types::LifetimedPinnedBoxedFutureResult, Priority, Service, ServiceInfo, ServiceManager};
use super::{BoxedError, Priority, Service, ServiceInfo, ServiceManager};
use log::{error, info, warn};
use serenity::{
all::{GatewayIntents, Ready},
async_trait,
client::{self, Cache, Context},
framework::{standard::Configuration, StandardFramework},

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 7 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling
gateway::{ShardManager, VoiceGatewayManager},
http::Http,
prelude::TypeMap,
Expand Down Expand Up @@ -52,97 +52,97 @@
}
}

//TODO: When Rust allows async trait methods to be object-safe, refactor this to not use async_trait anymore
#[async_trait]
impl Service for DiscordService {
fn info(&self) -> &ServiceInfo {
&self.info
}

fn start(&mut self, _service_manager: Arc<ServiceManager>) -> LifetimedPinnedBoxedFutureResult<'_, ()> {
Box::pin(async move {
let client_ready_notify = Arc::new(Notify::new());
async fn start(&mut self, _service_manager: Arc<ServiceManager>) -> Result<(), BoxedError> {
let client_ready_notify = Arc::new(Notify::new());

let framework = StandardFramework::new();
framework.configure(Configuration::new().prefix("!"));
let framework = StandardFramework::new();

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated struct `serenity::framework::StandardFramework`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 65 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated associated function `serenity::framework::StandardFramework::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling
framework.configure(Configuration::new().prefix("!"));

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (windows-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Build (macos-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (ubuntu-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (macos-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated struct `serenity::framework::standard::Configuration`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated method `serenity::framework::StandardFramework::configure`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated associated function `serenity::framework::standard::Configuration::new`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

Check warning on line 66 in src/service/discord.rs

View workflow job for this annotation

GitHub Actions / Test (windows-64)

use of deprecated method `serenity::framework::standard::Configuration::prefix`: The standard framework is deprecated, and will be removed in 0.13. Please migrate to `poise` for command handling

let mut client = Client::builder(self.discord_token.as_str(), GatewayIntents::all())
.framework(framework)
.event_handler(EventHandler::new(
Arc::clone(&self.ready),
Arc::clone(&client_ready_notify),
))
.await?;
let mut client = Client::builder(self.discord_token.as_str(), GatewayIntents::all())
.framework(framework)
.event_handler(EventHandler::new(
Arc::clone(&self.ready),
Arc::clone(&client_ready_notify),
))
.await?;

if self.cache.set(Arc::clone(&client.cache)).is_err() {
error!("Could not set cache OnceLock because it was already set. This should never happen.");
return Err("Could not set cache OnceLock because it was already set.".into());
}
if self.cache.set(Arc::clone(&client.cache)).is_err() {
error!("Could not set cache OnceLock because it was already set. This should never happen.");
return Err("Could not set cache OnceLock because it was already set.".into());
}

if self.data.set(Arc::clone(&client.data)).is_err() {
error!("Could not set data OnceLock because it was already set. This should never happen.");
return Err("Could not set data OnceLock because it was already set.".into());
}
if self.data.set(Arc::clone(&client.data)).is_err() {
error!("Could not set data OnceLock because it was already set. This should never happen.");
return Err("Could not set data OnceLock because it was already set.".into());
}

if self.http.set(Arc::clone(&client.http)).is_err() {
error!("Could not set http OnceLock because it was already set. This should never happen.");
return Err("Could not set http OnceLock because it was already set.".into());
}
if self.http.set(Arc::clone(&client.http)).is_err() {
error!("Could not set http OnceLock because it was already set. This should never happen.");
return Err("Could not set http OnceLock because it was already set.".into());
}

if self.shard_manager.set(Arc::clone(&client.shard_manager)).is_err() {
error!("Could not set shard_manager OnceLock because it was already set. This should never happen.");
return Err("Could not set shard_manager OnceLock because it was already set.".into());
}
if self.shard_manager.set(Arc::clone(&client.shard_manager)).is_err() {
error!(
"Could not set shard_manager OnceLock because it was already set. This should never happen."
);
return Err("Could not set shard_manager OnceLock because it was already set.".into());
}

if let Some(voice_manager) = &client.voice_manager {
if self.voice_manager.set(Arc::clone(voice_manager)).is_err() {
error!("Could not set voice_manager OnceLock because it was already set. This should never happen.");
return Err("Could not set voice_manager OnceLock because it was already set.".into());
}
} else {
warn!("Voice manager is not available");
if let Some(voice_manager) = &client.voice_manager {
if self.voice_manager.set(Arc::clone(voice_manager)).is_err() {
error!("Could not set voice_manager OnceLock because it was already set. This should never happen.");
return Err("Could not set voice_manager OnceLock because it was already set.".into());
}
} else {
warn!("Voice manager is not available");
}

if self.ws_url.set(Arc::clone(&client.ws_url)).is_err() {
error!("Could not set ws_url OnceLock because it was already set. This should never happen.");
return Err("Could not set ws_url OnceLock because it was already set.".into());
}
if self.ws_url.set(Arc::clone(&client.ws_url)).is_err() {
error!("Could not set ws_url OnceLock because it was already set. This should never happen.");
return Err("Could not set ws_url OnceLock because it was already set.".into());
}

let client_handle = spawn(async move { client.start().await });
let client_handle = spawn(async move { client.start().await });

select! {
_ = client_ready_notify.notified() => {},
_ = sleep(Duration::from_secs(2)) => {},
}
select! {
_ = client_ready_notify.notified() => {},
_ = sleep(Duration::from_secs(2)) => {},
}

if client_handle.is_finished() {
client_handle.await??;
return Err("Discord client stopped unexpectedly".into());
}
if client_handle.is_finished() {
client_handle.await??;
return Err("Discord client stopped unexpectedly".into());
}

self.client_handle = Some(client_handle);
Ok(())
})
self.client_handle = Some(client_handle);
Ok(())
}

fn stop(&mut self) -> LifetimedPinnedBoxedFutureResult<'_, ()> {
Box::pin(async move {
if let Some(client_handle) = self.client_handle.take() {
info!("Waiting for Discord client to stop...");
async fn stop(&mut self) -> Result<(), BoxedError> {
if let Some(client_handle) = self.client_handle.take() {
info!("Waiting for Discord client to stop...");

client_handle.abort(); // Should trigger a JoinError in the client_handle, if the task hasn't already ended
client_handle.abort(); // Should trigger a JoinError in the client_handle, if the task hasn't already ended

// If the thread ended WITHOUT a JoinError, the client already stopped unexpectedly
let result = async move {
match client_handle.await {
Ok(result) => result,
Err(_) => Ok(()),
}
// If the thread ended WITHOUT a JoinError, the client already stopped unexpectedly
let result = async move {
match client_handle.await {
Ok(result) => result,
Err(_) => Ok(()),
}
.await;
result?;
}
.await;
result?;
}

Ok(())
})
Ok(())
}
}

Expand All @@ -157,6 +157,7 @@
}
}

//TODO: When Rust allows async trait methods to be object-safe, refactor this to not use async_trait anymore
#[async_trait]
impl client::EventHandler for EventHandler {
async fn ready(&self, _ctx: Context, data_about_bot: Ready) {
Expand Down
15 changes: 9 additions & 6 deletions src/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ use std::{
sync::Arc,
};

use async_trait::async_trait;
use downcast_rs::{impl_downcast, DowncastSync};

use crate::event::Observable;

use super::{
service_manager::ServiceManager,
types::{LifetimedPinnedBoxedFuture, LifetimedPinnedBoxedFutureResult, Priority, Status},
types::{Priority, Status},
BoxedError, LifetimedPinnedBoxedFutureResult,
};

#[derive(Debug)]
Expand Down Expand Up @@ -58,17 +60,18 @@ impl Hash for ServiceInfo {
self.id.hash(state);
}
}
//TODO: When Rust allows async trait methods to be object-safe, refactor this to use async instead of returning a PinnedBoxedFutureResult
//TODO: When Rust allows async trait methods to be object-safe, refactor this to not use async_trait anymore
#[async_trait]
pub trait Service: DowncastSync {
fn info(&self) -> &ServiceInfo;
fn start(&mut self, service_manager: Arc<ServiceManager>) -> LifetimedPinnedBoxedFutureResult<'_, ()>;
fn stop(&mut self) -> LifetimedPinnedBoxedFutureResult<'_, ()>;
async fn start(&mut self, service_manager: Arc<ServiceManager>) -> Result<(), BoxedError>;
async fn stop(&mut self) -> Result<(), BoxedError>;
fn task<'a>(&self) -> Option<LifetimedPinnedBoxedFutureResult<'a, ()>> {
None
}

fn is_available(&self) -> LifetimedPinnedBoxedFuture<'_, bool> {
Box::pin(async move { matches!(self.info().status.get().await, Status::Started) })
async fn is_available(&self) -> bool {
matches!(self.info().status.get().await, Status::Started)
}
}

Expand Down
Loading
Loading