pub struct InMemoryResolver {Show 19 fields
spells: IntMap<i32, SpellDataFlat>,
effects: IntMap<i32, Vec<SpellEffect>>,
items: IntMap<i32, ItemDataFlat>,
specs: IntMap<i32, SpecDataFlat>,
trait_trees: IntMap<i32, TraitTreeFlat>,
expansion_trait_trees: FastMap<ExpansionTraitTreeKey, ExpansionTraitTreeFlat>,
rotation_scripts: FastMap<String, String>,
expected_stats: FastMap<ExpectedStatsKey, ExpectedStatFlat>,
scaling_data: Option<Arc<ItemScalingData>>,
power_types: Vec<PowerTypeFlat>,
enchantments: IntMap<i32, EnchantmentRow>,
permanent_enchants: Vec<PermanentEnchantFlat>,
creatures: IntMap<i32, CreatureFlat>,
creature_difficulties: IntMap<i32, Vec<CreatureDifficultyFlat>>,
content_tunings: IntMap<i32, ContentTuningFlat>,
content_tuning_x_difficulty: IntMap<i32, Vec<ContentTuningXDifficultyFlat>>,
content_tuning_x_expected: IntMap<i32, Vec<ContentTuningXExpectedFlat>>,
expected_stat_mods: IntMap<i32, ExpectedStatModFlat>,
challenge_mode_health: IntMap<i32, ChallengeModeHealthFlat>,
}Expand description
In-memory data resolver populated through builder methods.
Fields§
§spells: IntMap<i32, SpellDataFlat>§effects: IntMap<i32, Vec<SpellEffect>>§items: IntMap<i32, ItemDataFlat>§specs: IntMap<i32, SpecDataFlat>§trait_trees: IntMap<i32, TraitTreeFlat>§expansion_trait_trees: FastMap<ExpansionTraitTreeKey, ExpansionTraitTreeFlat>§rotation_scripts: FastMap<String, String>§expected_stats: FastMap<ExpectedStatsKey, ExpectedStatFlat>§scaling_data: Option<Arc<ItemScalingData>>§power_types: Vec<PowerTypeFlat>§enchantments: IntMap<i32, EnchantmentRow>§permanent_enchants: Vec<PermanentEnchantFlat>§creatures: IntMap<i32, CreatureFlat>§creature_difficulties: IntMap<i32, Vec<CreatureDifficultyFlat>>§content_tunings: IntMap<i32, ContentTuningFlat>§content_tuning_x_difficulty: IntMap<i32, Vec<ContentTuningXDifficultyFlat>>§content_tuning_x_expected: IntMap<i32, Vec<ContentTuningXExpectedFlat>>§expected_stat_mods: IntMap<i32, ExpectedStatModFlat>§challenge_mode_health: IntMap<i32, ChallengeModeHealthFlat>Implementations§
Source§impl InMemoryResolver
impl InMemoryResolver
Sourcepub fn with_spell(self, spell: SpellDataFlat) -> Self
pub fn with_spell(self, spell: SpellDataFlat) -> Self
Adds or replaces a spell keyed by its ID.
Sourcepub fn with_effects(self, spell_id: i32, effects: Vec<SpellEffect>) -> Self
pub fn with_effects(self, spell_id: i32, effects: Vec<SpellEffect>) -> Self
Adds or replaces the effect list for a spell and sorts it by zero-based DBC index.
Sourcepub fn with_item(self, item: ItemDataFlat) -> Self
pub fn with_item(self, item: ItemDataFlat) -> Self
Adds or replaces an item keyed by its ID.
Sourcepub fn with_enchantment(self, enchantment: EnchantmentRow) -> Self
pub fn with_enchantment(self, enchantment: EnchantmentRow) -> Self
Adds or replaces an enchantment keyed by its ID.
Sourcepub fn with_permanent_enchant(self, enchantment: PermanentEnchantFlat) -> Self
pub fn with_permanent_enchant(self, enchantment: PermanentEnchantFlat) -> Self
Appends one profession-derived permanent-enchant index entry.
Sourcepub fn with_spec(self, spec: SpecDataFlat) -> Self
pub fn with_spec(self, spec: SpecDataFlat) -> Self
Adds or replaces a specialization keyed by its ID.
Sourcepub fn with_trait_tree(self, tree: TraitTreeFlat) -> Self
pub fn with_trait_tree(self, tree: TraitTreeFlat) -> Self
Adds or replaces a specialization trait tree.
Sourcepub fn with_expansion_trait_tree(self, tree: ExpansionTraitTreeFlat) -> Self
pub fn with_expansion_trait_tree(self, tree: ExpansionTraitTreeFlat) -> Self
Adds or replaces an expansion-wide trait tree.
Sourcepub fn with_rotation_script(
self,
id: impl Into<String>,
script: impl Into<String>,
) -> Self
pub fn with_rotation_script( self, id: impl Into<String>, script: impl Into<String>, ) -> Self
Adds or replaces a rotation script.
Sourcepub fn with_expected_stats(self, stats: ExpectedStatFlat) -> Self
pub fn with_expected_stats(self, stats: ExpectedStatFlat) -> Self
Adds or replaces an expected-stat row keyed by expansion and level.
Sourcepub fn with_scaling_data(self, data: ItemScalingData) -> Self
pub fn with_scaling_data(self, data: ItemScalingData) -> Self
Replaces the complete item-scaling data set.
Sourcepub fn with_power_types(self, power_types: Vec<PowerTypeFlat>) -> Self
pub fn with_power_types(self, power_types: Vec<PowerTypeFlat>) -> Self
Replaces the complete power-type list.
Sourcepub fn with_creature(self, creature: CreatureFlat) -> Self
pub fn with_creature(self, creature: CreatureFlat) -> Self
Adds or replaces a creature keyed by its ID.
Sourcepub fn with_creature_difficulty(self, row: CreatureDifficultyFlat) -> Self
pub fn with_creature_difficulty(self, row: CreatureDifficultyFlat) -> Self
Appends a difficulty row for its creature.
Sourcepub fn with_content_tuning(self, tuning: ContentTuningFlat) -> Self
pub fn with_content_tuning(self, tuning: ContentTuningFlat) -> Self
Adds or replaces a content-tuning row keyed by its ID.
Sourcepub fn with_content_tuning_x_difficulty(
self,
row: ContentTuningXDifficultyFlat,
) -> Self
pub fn with_content_tuning_x_difficulty( self, row: ContentTuningXDifficultyFlat, ) -> Self
Appends a difficulty mapping for its content-tuning ID.
Sourcepub fn with_content_tuning_x_expected(
self,
row: ContentTuningXExpectedFlat,
) -> Self
pub fn with_content_tuning_x_expected( self, row: ContentTuningXExpectedFlat, ) -> Self
Appends an expected-stat mapping for its content-tuning ID.
Sourcepub fn with_expected_stat_mod(self, stat_mod: ExpectedStatModFlat) -> Self
pub fn with_expected_stat_mod(self, stat_mod: ExpectedStatModFlat) -> Self
Adds or replaces an expected-stat modifier keyed by its ID.
Sourcepub fn with_challenge_mode_health(self, health: ChallengeModeHealthFlat) -> Self
pub fn with_challenge_mode_health(self, health: ChallengeModeHealthFlat) -> Self
Adds or replaces a challenge-mode health row keyed by keystone level.
fn resolve_spells( &self, spell_ids: &[SpellId], ) -> Result<Vec<SpellDataFlat>, ResolverError>
Trait Implementations§
Source§impl DataResolver for InMemoryResolver
impl DataResolver for InMemoryResolver
async fn get_spell( &self, spell_id: SpellId, ) -> Result<SpellDataFlat, ResolverError>
async fn get_spells( &self, spell_ids: &[SpellId], ) -> Result<Vec<SpellDataFlat>, ResolverError>
Source§async fn get_spell_effect(
&self,
spell_id: SpellId,
effect_index: u8,
) -> Result<SpellEffect, ResolverError>
async fn get_spell_effect( &self, spell_id: SpellId, effect_index: u8, ) -> Result<SpellEffect, ResolverError>
effect_index is 1-based (author-facing).async fn get_spell_effects( &self, spell_id: SpellId, ) -> Result<Vec<SpellEffect>, ResolverError>
async fn get_item(&self, item_id: i32) -> Result<ItemDataFlat, ResolverError>
Source§async fn find_consumable_items(
&self,
name_token: &str,
subclass: i32,
) -> Result<Vec<ItemDataFlat>, ResolverError>
async fn find_consumable_items( &self, name_token: &str, subclass: i32, ) -> Result<Vec<ItemDataFlat>, ResolverError>
name_token.async fn get_scaling_data(&self) -> Result<Arc<ItemScalingData>, ResolverError>
async fn get_power_types(&self) -> Result<Vec<PowerTypeFlat>, ResolverError>
async fn get_spec(&self, spec_id: i32) -> Result<SpecDataFlat, ResolverError>
async fn get_trait_tree( &self, spec_id: i32, ) -> Result<TraitTreeFlat, ResolverError>
Source§async fn get_expansion_trait_tree(
&self,
expansion_id: i32,
system: &str,
) -> Result<ExpansionTraitTreeFlat, ResolverError>
async fn get_expansion_trait_tree( &self, expansion_id: i32, system: &str, ) -> Result<ExpansionTraitTreeFlat, ResolverError>
async fn get_rotation_script( &self, rotation_id: &str, ) -> Result<String, ResolverError>
Source§async fn get_spell_overrides(
&self,
_spec_id: i32,
) -> Result<Vec<(SpellId, SpellId)>, ResolverError>
async fn get_spell_overrides( &self, _spec_id: i32, ) -> Result<Vec<(SpellId, SpellId)>, ResolverError>
Ok(vec![]).Source§async fn get_specialization_spells(
&self,
_spec_id: i32,
) -> Result<Vec<SpellId>, ResolverError>
async fn get_specialization_spells( &self, _spec_id: i32, ) -> Result<Vec<SpellId>, ResolverError>
SpecializationSpells; a backend with no table returns Ok(vec![]).Source§async fn get_racial_spells(
&self,
_race_id: i32,
_class_id: i32,
) -> Result<Vec<SpellId>, ResolverError>
async fn get_racial_spells( &self, _race_id: i32, _class_id: i32, ) -> Result<Vec<SpellId>, ResolverError>
Ok(vec![]). Read moreSource§async fn get_expected_stats(
&self,
expansion_id: i32,
lvl: i32,
) -> Result<ExpectedStatFlat, ResolverError>
async fn get_expected_stats( &self, expansion_id: i32, lvl: i32, ) -> Result<ExpectedStatFlat, ResolverError>
ExpectedStatsNotFound when a backend cannot source it.Source§async fn get_item_damage_scaling(
&self,
item_level: i32,
weapon_type: &str,
) -> Result<ItemDamageScalingFlat, ResolverError>
async fn get_item_damage_scaling( &self, item_level: i32, weapon_type: &str, ) -> Result<ItemDamageScalingFlat, ResolverError>
ItemDamageScalingNotFound when a backend cannot source it.Source§async fn get_enchantment(
&self,
enchantment_id: i32,
) -> Result<EnchantmentRow, ResolverError>
async fn get_enchantment( &self, enchantment_id: i32, ) -> Result<EnchantmentRow, ResolverError>
EnchantmentNotFound when a backend cannot source it.Source§async fn find_permanent_enchant(
&self,
query: &PermanentEnchantQuery,
) -> Result<Option<PermanentEnchantFlat>, ResolverError>
async fn find_permanent_enchant( &self, query: &PermanentEnchantQuery, ) -> Result<Option<PermanentEnchantFlat>, ResolverError>
SimC index.Source§async fn get_creature(
&self,
creature_id: i32,
) -> Result<CreatureFlat, ResolverError>
async fn get_creature( &self, creature_id: i32, ) -> Result<CreatureFlat, ResolverError>
Creature table) by NPC ID; defaults to Unsupported until a backend implements enemy resolution.Source§async fn get_creature_difficulties(
&self,
creature_id: i32,
) -> Result<Vec<CreatureDifficultyFlat>, ResolverError>
async fn get_creature_difficulties( &self, creature_id: i32, ) -> Result<Vec<CreatureDifficultyFlat>, ResolverError>
CreatureDifficulty variant for a creature; defaults to Unsupported until a backend implements enemy resolution.Source§async fn get_content_tuning(
&self,
content_tuning_id: i32,
) -> Result<ContentTuningFlat, ResolverError>
async fn get_content_tuning( &self, content_tuning_id: i32, ) -> Result<ContentTuningFlat, ResolverError>
ContentTuning row by ID; defaults to Unsupported until a backend implements enemy resolution.Source§async fn get_content_tuning_x_difficulty(
&self,
content_tuning_id: i32,
) -> Result<Vec<ContentTuningXDifficultyFlat>, ResolverError>
async fn get_content_tuning_x_difficulty( &self, content_tuning_id: i32, ) -> Result<Vec<ContentTuningXDifficultyFlat>, ResolverError>
ContentTuningXDifficulty mapping for a content tuning; defaults to Unsupported until a backend implements enemy resolution.Source§async fn get_content_tuning_x_expected(
&self,
content_tuning_id: i32,
) -> Result<Vec<ContentTuningXExpectedFlat>, ResolverError>
async fn get_content_tuning_x_expected( &self, content_tuning_id: i32, ) -> Result<Vec<ContentTuningXExpectedFlat>, ResolverError>
ContentTuningXExpected mapping; row selection stays in the application layer.Source§async fn get_expected_stat_mod(
&self,
expected_stat_mod_id: i32,
) -> Result<ExpectedStatModFlat, ResolverError>
async fn get_expected_stat_mod( &self, expected_stat_mod_id: i32, ) -> Result<ExpectedStatModFlat, ResolverError>
ExpectedStatMod multiplier row by ID.Source§async fn get_challenge_mode_health(
&self,
keystone_level: i32,
) -> Result<ChallengeModeHealthFlat, ResolverError>
async fn get_challenge_mode_health( &self, keystone_level: i32, ) -> Result<ChallengeModeHealthFlat, ResolverError>
ChallengeModeHealth GameTable scalar by keystone level.Source§fn search_spells(
&self,
query: &str,
limit: u32,
) -> impl Future<Output = Result<Vec<SpellSearchResult>, ResolverError>> + Send
fn search_spells( &self, query: &str, limit: u32, ) -> impl Future<Output = Result<Vec<SpellSearchResult>, ResolverError>> + Send
Unsupported; a backend with no search index fails loud rather than returning empty.Source§fn decode_traits(
&self,
spec_id: i32,
trait_string: &str,
) -> impl Future<Output = Result<TraitTreeWithSelections, ResolverError>> + Send
fn decode_traits( &self, spec_id: i32, trait_string: &str, ) -> impl Future<Output = Result<TraitTreeWithSelections, ResolverError>> + Send
Source§impl Debug for InMemoryResolver
impl Debug for InMemoryResolver
Source§impl Default for InMemoryResolver
impl Default for InMemoryResolver
Source§fn default() -> InMemoryResolver
fn default() -> InMemoryResolver
Auto Trait Implementations§
impl Freeze for InMemoryResolver
impl RefUnwindSafe for InMemoryResolver
impl Send for InMemoryResolver
impl Sync for InMemoryResolver
impl Unpin for InMemoryResolver
impl UnsafeUnpin for InMemoryResolver
impl UnwindSafe for InMemoryResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more