pub struct ResolveConfig {
pub timeout: Duration,
pub reset_globals: bool,
pub globals: Globals,
pub tracing: bool,
pub skip_cleanup: bool,
}Expand description
Configuration for Resolve instances
Can be used to increase the internal ping timeout and or if it should reset globals after every execution.
Fields§
§timeout: DurationThe default timeout for Scripts if they don’t specify their own timeout
reset_globals: boolIf the module should reset the lua globals between every request.
For short, small requests, this can increase performance by a good bit.
You just need to make sure you use local variables in lua and don’t clutter the global table to mess with different scripts
globals: GlobalsGlobal variables that will always exist.
These globals won’t care for reset_globals as that is only for script executed globals.
tracing: boolEnables trace logging in the lua module, logs will be written to a file in the instance’s temporary directory (dir)
skip_cleanup: boolEvery so often when you create a Resolve instance, it will run a background cleanup job to remove stale files created by the crate.
This skips this cleanup and never runs it when creating this instance
Implementations§
Source§impl ResolveConfig
impl ResolveConfig
Sourcepub fn keep_globals() -> Self
pub fn keep_globals() -> Self
Default configuration except that globals don’t get reset
Source§impl ResolveConfig
impl ResolveConfig
Sourcepub fn reset_globals(self, reset_globals: bool) -> Self
pub fn reset_globals(self, reset_globals: bool) -> Self
Set’s reset_globals to the specified value.
Sourcepub fn skip_cleanup(self, skip_cleanup: bool) -> Self
pub fn skip_cleanup(self, skip_cleanup: bool) -> Self
Set’s skip_cleanup to the specified value.
Trait Implementations§
Source§impl Clone for ResolveConfig
impl Clone for ResolveConfig
Source§fn clone(&self) -> ResolveConfig
fn clone(&self) -> ResolveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more