serenade_console/
input.rs1use std::sync::Arc;
4
5use serenade_di::Container;
6use serenade_kernel::Environment;
7
8#[derive(Clone)]
10pub struct Input {
11 environment: Environment,
12 debug: bool,
13 args: Vec<String>,
14 container: Option<Arc<Container>>,
15}
16
17impl Input {
18 #[must_use]
20 pub const fn new(
21 environment: Environment,
22 debug: bool,
23 args: Vec<String>,
24 container: Option<Arc<Container>>,
25 ) -> Self {
26 Self {
27 environment,
28 debug,
29 args,
30 container,
31 }
32 }
33
34 #[must_use]
36 pub const fn environment(&self) -> &Environment {
37 &self.environment
38 }
39
40 #[must_use]
42 pub const fn debug(&self) -> bool {
43 self.debug
44 }
45
46 #[must_use]
48 pub fn args(&self) -> &[String] {
49 &self.args
50 }
51
52 #[must_use]
54 pub const fn container(&self) -> Option<&Arc<Container>> {
55 self.container.as_ref()
56 }
57}