Skip to main content

LocalCsvResolver

Struct LocalCsvResolver 

Source
pub struct LocalCsvResolver {
Show 22 fields data_dir: PathBuf, spells: Mutex<Option<IntMap<i32, SpellDataFlat>>>, items: Mutex<Option<IntMap<i32, ItemDataFlat>>>, specs: Mutex<Option<IntMap<i32, SpecDataFlat>>>, traits: Mutex<Option<IntMap<i32, TraitTreeFlat>>>, enchantments: Mutex<Option<IntMap<i32, EnchantmentFlat>>>, creatures: Mutex<Option<IntMap<i32, CreatureFlat>>>, content_tunings: Mutex<Option<IntMap<i32, ContentTuningFlat>>>, expected_stat_mods: Mutex<Option<IntMap<i32, ExpectedStatModFlat>>>, challenge_mode_health: Mutex<Option<IntMap<i32, ChallengeModeHealthFlat>>>, spec_spells: Mutex<Option<IntMap<i32, Vec<SpecializationSpellFlat>>>>, racial_spells: Mutex<Option<IntMap<i32, Vec<RacialSpellFlat>>>>, creature_difficulties: Mutex<Option<IntMap<i32, Vec<CreatureDifficultyFlat>>>>, content_tuning_x_difficulty: Mutex<Option<IntMap<i32, Vec<ContentTuningXDifficultyFlat>>>>, content_tuning_x_expected: Mutex<Option<IntMap<i32, Vec<ContentTuningXExpectedFlat>>>>, dbc: Mutex<Option<Arc<DbcData>>>, expansion_traits: Mutex<Option<Vec<ExpansionTraitTreeFlat>>>, scaling_data: Mutex<Option<Arc<ItemScalingData>>>, power_types: Mutex<Option<Arc<[PowerTypeFlat]>>>, item_damage: Mutex<Option<FastMap<String, IntMap<i32, ItemDamageScalingFlat>>>>, expected_stats: Mutex<Option<FastMap<ExpectedStatsKey, ExpectedStatFlat>>>, permanent_enchants: Mutex<Option<Arc<[PermanentEnchantFlat]>>>,
}
Expand description

Resolver backed by lazily cached DBC-derived CSV files.

Fields§

§data_dir: PathBuf§spells: Mutex<Option<IntMap<i32, SpellDataFlat>>>§items: Mutex<Option<IntMap<i32, ItemDataFlat>>>§specs: Mutex<Option<IntMap<i32, SpecDataFlat>>>§traits: Mutex<Option<IntMap<i32, TraitTreeFlat>>>§enchantments: Mutex<Option<IntMap<i32, EnchantmentFlat>>>§creatures: Mutex<Option<IntMap<i32, CreatureFlat>>>§content_tunings: Mutex<Option<IntMap<i32, ContentTuningFlat>>>§expected_stat_mods: Mutex<Option<IntMap<i32, ExpectedStatModFlat>>>§challenge_mode_health: Mutex<Option<IntMap<i32, ChallengeModeHealthFlat>>>§spec_spells: Mutex<Option<IntMap<i32, Vec<SpecializationSpellFlat>>>>§racial_spells: Mutex<Option<IntMap<i32, Vec<RacialSpellFlat>>>>§creature_difficulties: Mutex<Option<IntMap<i32, Vec<CreatureDifficultyFlat>>>>§content_tuning_x_difficulty: Mutex<Option<IntMap<i32, Vec<ContentTuningXDifficultyFlat>>>>§content_tuning_x_expected: Mutex<Option<IntMap<i32, Vec<ContentTuningXExpectedFlat>>>>§dbc: Mutex<Option<Arc<DbcData>>>§expansion_traits: Mutex<Option<Vec<ExpansionTraitTreeFlat>>>§scaling_data: Mutex<Option<Arc<ItemScalingData>>>§power_types: Mutex<Option<Arc<[PowerTypeFlat]>>>§item_damage: Mutex<Option<FastMap<String, IntMap<i32, ItemDamageScalingFlat>>>>§expected_stats: Mutex<Option<FastMap<ExpectedStatsKey, ExpectedStatFlat>>>§permanent_enchants: Mutex<Option<Arc<[PermanentEnchantFlat]>>>

Implementations§

Source§

impl LocalCsvResolver

Source

fn empty(data_dir: PathBuf) -> Self

Source

fn read_spells<R>( &self, access: impl FnOnce(&IntMap<i32, SpellDataFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_items<R>( &self, access: impl FnOnce(&IntMap<i32, ItemDataFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_specs<R>( &self, access: impl FnOnce(&IntMap<i32, SpecDataFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_traits<R>( &self, access: impl FnOnce(&IntMap<i32, TraitTreeFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_enchantments<R>( &self, access: impl FnOnce(&IntMap<i32, EnchantmentFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_creatures<R>( &self, access: impl FnOnce(&IntMap<i32, CreatureFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_content_tunings<R>( &self, access: impl FnOnce(&IntMap<i32, ContentTuningFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_expected_stat_mods<R>( &self, access: impl FnOnce(&IntMap<i32, ExpectedStatModFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_challenge_mode_health<R>( &self, access: impl FnOnce(&IntMap<i32, ChallengeModeHealthFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn read_spec_spells<R>( &self, access: impl FnOnce(&IntMap<i32, Vec<SpecializationSpellFlat>>) -> R, ) -> Result<R, ResolverError>

Source

fn read_racial_spells<R>( &self, access: impl FnOnce(&IntMap<i32, Vec<RacialSpellFlat>>) -> R, ) -> Result<R, ResolverError>

Source

fn read_creature_difficulties<R>( &self, access: impl FnOnce(&IntMap<i32, Vec<CreatureDifficultyFlat>>) -> R, ) -> Result<R, ResolverError>

Source

fn read_content_tuning_x_difficulty<R>( &self, access: impl FnOnce(&IntMap<i32, Vec<ContentTuningXDifficultyFlat>>) -> R, ) -> Result<R, ResolverError>

Source

fn read_content_tuning_x_expected<R>( &self, access: impl FnOnce(&IntMap<i32, Vec<ContentTuningXExpectedFlat>>) -> R, ) -> Result<R, ResolverError>

Source§

impl LocalCsvResolver

Source

pub fn new(data_dir: impl Into<PathBuf>) -> Self

Creates a resolver rooted at a directory of DBC-derived CSV files.

Source

fn read_category<T, R>( &self, slot: &Mutex<Option<IntMap<i32, T>>>, transform: fn(&DbcData) -> Vec<T>, key_of: fn(&T) -> i32, access: impl FnOnce(&IntMap<i32, T>) -> R, ) -> Result<R, ResolverError>

Source

fn read_grouped<T, R>( &self, slot: &Mutex<Option<IntMap<i32, Vec<T>>>>, transform: fn(&DbcData) -> Vec<T>, key_of: fn(&T) -> i32, access: impl FnOnce(&IntMap<i32, Vec<T>>) -> R, ) -> Result<R, ResolverError>

Source

fn shared_dbc(&self) -> Result<Arc<DbcData>, ResolverError>

Source

fn ensure_scaling_data(&self) -> Result<Arc<ItemScalingData>, ResolverError>

Source

fn ensure_power_types(&self) -> Result<Arc<[PowerTypeFlat]>, ResolverError>

Source

fn ensure_item_damage<R>( &self, access: impl FnOnce(&FastMap<String, IntMap<i32, ItemDamageScalingFlat>>) -> R, ) -> Result<R, ResolverError>

Source

fn ensure_expected_stats<R>( &self, access: impl FnOnce(&FastMap<ExpectedStatsKey, ExpectedStatFlat>) -> R, ) -> Result<R, ResolverError>

Source

fn ensure_permanent_enchants( &self, ) -> Result<Arc<[PermanentEnchantFlat]>, ResolverError>

Trait Implementations§

Source§

impl DataResolver for LocalCsvResolver

Source§

async fn get_spell( &self, spell_id: SpellId, ) -> Result<SpellDataFlat, ResolverError>

Source§

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>

effect_index is 1-based (author-facing).
Source§

async fn get_spell_effects( &self, spell_id: SpellId, ) -> Result<Vec<SpellEffect>, ResolverError>

Source§

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>

Finds consumable items whose tokenized names contain name_token.
Source§

async fn get_scaling_data(&self) -> Result<Arc<ItemScalingData>, ResolverError>

Source§

async fn get_item_damage_scaling( &self, item_level: i32, weapon_type: &str, ) -> Result<ItemDamageScalingFlat, ResolverError>

Required for resolver parity: return ItemDamageScalingNotFound when a backend cannot source it.
Source§

async fn get_expected_stats( &self, expansion_id: i32, lvl: i32, ) -> Result<ExpectedStatFlat, ResolverError>

Required for resolver parity: return ExpectedStatsNotFound when a backend cannot source it.
Source§

async fn get_enchantment( &self, enchantment_id: i32, ) -> Result<EnchantmentRow, ResolverError>

Required for resolver parity: return EnchantmentNotFound when a backend cannot source it.
Source§

async fn find_permanent_enchant( &self, query: &PermanentEnchantQuery, ) -> Result<Option<PermanentEnchantFlat>, ResolverError>

Resolves a named permanent enchant through the profession-derived SimC index.
Source§

async fn get_power_types(&self) -> Result<Vec<PowerTypeFlat>, ResolverError>

Source§

async fn get_spec(&self, spec_id: i32) -> Result<SpecDataFlat, ResolverError>

Source§

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>

Fetch a class-agnostic expansion progression tree, such as Midnight’s Omnium Folio.
Source§

async fn get_spell_overrides( &self, spec_id: i32, ) -> Result<Vec<(SpellId, SpellId)>, ResolverError>

Required for resolver parity: a backend with no override table returns Ok(vec![]).
Source§

async fn get_specialization_spells( &self, spec_id: i32, ) -> Result<Vec<SpellId>, ResolverError>

Every spell id assigned to the spec in 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>

Every racial ability the race grants the class; a backend with no table returns Ok(vec![]). Read more
Source§

async fn get_creature( &self, creature_id: i32, ) -> Result<CreatureFlat, ResolverError>

Creature identity row (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>

Every 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>

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>

Every 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>

Every 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>

ExpectedStatMod multiplier row by ID.
Source§

async fn get_challenge_mode_health( &self, keystone_level: i32, ) -> Result<ChallengeModeHealthFlat, ResolverError>

ChallengeModeHealth GameTable scalar by keystone level.
Source§

async fn get_rotation_script( &self, rotation_id: &str, ) -> Result<String, ResolverError>

Source§

fn search_spells( &self, query: &str, limit: u32, ) -> impl Future<Output = Result<Vec<SpellSearchResult>, ResolverError>> + Send

Defaults to 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

Decode a loadout string against this spec’s tree into a raw selected tree; talent-tree interpretation is the caller’s job.
Source§

impl Debug for LocalCsvResolver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SpecConfig for T
where T: Any + Debug + Send,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> ResolverSyncBound for T
where T: Sync + ?Sized,