pub trait ScriptEvaluator {
type Shared<'a>;
type VariableStore: VariableStore;
// Required methods
fn get_variable_store<'a>(
&self,
shared: &'a mut Self::Shared<'_>,
) -> &'a mut Self::VariableStore;
fn eval_condition(
&mut self,
shared: &mut Self::Shared<'_>,
condition: &ConditionKind,
) -> Result<bool>;
fn add_dependency(
&mut self,
shared: &mut Self::Shared<'_>,
dep: Vec<RequiredPackage>,
) -> Result<()>;
fn add_conflict(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>;
fn add_recommendation(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: RecommendedPackage,
) -> Result<()>;
fn add_bundled(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>;
fn add_compat(
&mut self,
shared: &mut Self::Shared<'_>,
compat: (PackageID, PackageID),
) -> Result<()>;
fn add_extension(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>;
fn add_notice(
&mut self,
shared: &mut Self::Shared<'_>,
notice: String,
) -> Result<()>;
fn add_command(
&mut self,
shared: &mut Self::Shared<'_>,
command: Vec<String>,
) -> Result<()>;
fn add_addon(
&mut self,
shared: &mut Self::Shared<'_>,
addon: AddonInstructionData,
) -> Result<()>;
fn run_custom(
&mut self,
shared: &mut Self::Shared<'_>,
command: String,
args: Vec<String>,
) -> Result<()>;
}
Expand description
A trait for a type that has specific implementations of package script evaluation functions
Required Associated Types§
The shared evaluation state to provide to methods
Sourcetype VariableStore: VariableStore
type VariableStore: VariableStore
The type of variable store to use
Required Methods§
Sourcefn get_variable_store<'a>(
&self,
shared: &'a mut Self::Shared<'_>,
) -> &'a mut Self::VariableStore
fn get_variable_store<'a>( &self, shared: &'a mut Self::Shared<'_>, ) -> &'a mut Self::VariableStore
Get the evaluator’s variable store from the shared data
Sourcefn eval_condition(
&mut self,
shared: &mut Self::Shared<'_>,
condition: &ConditionKind,
) -> Result<bool>
fn eval_condition( &mut self, shared: &mut Self::Shared<'_>, condition: &ConditionKind, ) -> Result<bool>
Evaluate a condition
Sourcefn add_dependency(
&mut self,
shared: &mut Self::Shared<'_>,
dep: Vec<RequiredPackage>,
) -> Result<()>
fn add_dependency( &mut self, shared: &mut Self::Shared<'_>, dep: Vec<RequiredPackage>, ) -> Result<()>
Add a dependency
Sourcefn add_conflict(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>
fn add_conflict( &mut self, shared: &mut Self::Shared<'_>, pkg: PackageID, ) -> Result<()>
Add a conflict
Sourcefn add_recommendation(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: RecommendedPackage,
) -> Result<()>
fn add_recommendation( &mut self, shared: &mut Self::Shared<'_>, pkg: RecommendedPackage, ) -> Result<()>
Add a recommendation
Sourcefn add_bundled(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>
fn add_bundled( &mut self, shared: &mut Self::Shared<'_>, pkg: PackageID, ) -> Result<()>
Add a bundled package
Sourcefn add_compat(
&mut self,
shared: &mut Self::Shared<'_>,
compat: (PackageID, PackageID),
) -> Result<()>
fn add_compat( &mut self, shared: &mut Self::Shared<'_>, compat: (PackageID, PackageID), ) -> Result<()>
Add a compat
Sourcefn add_extension(
&mut self,
shared: &mut Self::Shared<'_>,
pkg: PackageID,
) -> Result<()>
fn add_extension( &mut self, shared: &mut Self::Shared<'_>, pkg: PackageID, ) -> Result<()>
Add an extension
Sourcefn add_notice(
&mut self,
shared: &mut Self::Shared<'_>,
notice: String,
) -> Result<()>
fn add_notice( &mut self, shared: &mut Self::Shared<'_>, notice: String, ) -> Result<()>
Add a notice
Sourcefn add_command(
&mut self,
shared: &mut Self::Shared<'_>,
command: Vec<String>,
) -> Result<()>
fn add_command( &mut self, shared: &mut Self::Shared<'_>, command: Vec<String>, ) -> Result<()>
Add a command
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.