tulpje_framework/context/
task_context.rs1use std::sync::Arc;
2use twilight_http::Client;
3use twilight_model::id::{Id, marker::ApplicationMarker};
4
5use super::Context;
6
7#[derive(Debug)]
8pub struct TaskContext<T: Clone + Send + Sync> {
9 pub application_id: Id<ApplicationMarker>,
10 pub services: Arc<T>,
11 pub client: Arc<Client>,
12}
13
14impl<T: Clone + Send + Sync> TaskContext<T> {
15 pub fn from_context(ctx: Context<T>) -> Self {
16 Self {
17 application_id: ctx.application_id,
18 services: ctx.services,
19 client: ctx.client,
20 }
21 }
22}