javy_plugin_api/
config.rs

1use std::ops::{Deref, DerefMut};
2
3#[derive(Default)]
4/// A configuration for the Javy plugin API.
5pub struct Config {
6    /// The runtime config.
7    pub(crate) runtime_config: javy::Config,
8    /// Whether to enable the event loop.
9    pub(crate) event_loop: bool,
10}
11
12impl Config {
13    /// Whether to enable the event loop.
14    pub fn event_loop(&mut self, enabled: bool) -> &mut Self {
15        self.event_loop = enabled;
16        self
17    }
18}
19
20impl Deref for Config {
21    type Target = javy::Config;
22
23    fn deref(&self) -> &Self::Target {
24        &self.runtime_config
25    }
26}
27
28impl DerefMut for Config {
29    fn deref_mut(&mut self) -> &mut Self::Target {
30        &mut self.runtime_config
31    }
32}