pub struct Block {
v: Vec<BlockItem>,
pub tag: Option<Box<Token>>,
pub loc: Loc,
pub source: Option<Box<(Vec<MacroComponent>, PdxfileMemory)>>,
}Expand description
This type represents the most basic structural element of Pdx script code.
Blocks are delimited by { and }. An entire file is also a Block.
A Block can contain a mix of these kinds of items:
- Assignments:
key = value - Definitions:
key = { ... } - Loose sub-blocks:
{ ... } { ... } ... - Loose values:
value value ... - Comparisons:
key < valuefor a variety of comparators, including=for equality key < { ... }is accepted by the parser but is not used anywhere
The same key can occur multiple times in a block. If a single field is requested and its key occurs multiple times, the last instance is returned (which is how the game usually resolves this).
Fields§
§v: Vec<BlockItem>The contents of this block.
tag: Option<Box<Token>>The tag is a short string that precedes a block, as in color = hsv { 0.5 0.5 1.0 }.
Only a small number of hardcoded tags are parsed this way.
It is in a Box to save space in blocks that don’t have a tag, which is most of them.
loc: LocThe location of the start of the block. Used mostly for error reporting.
source: Option<Box<(Vec<MacroComponent>, PdxfileMemory)>>If the block is a top-level block and contains macro substitutions, this field will
hold the original source for re-parsing.
The source has already been split into a vec that alternates content with macro parameters.
It is in a Box to save space (80 bytes) from blocks that don’t contain macro substitutions,
which is most of them.
Implementations§
Source§impl Block
impl Block
Sourcepub fn add_value(&mut self, value: Token)
pub fn add_value(&mut self, value: Token)
Add a loose value to this Block. Mostly used by the parser.
Sourcepub fn add_block(&mut self, block: Block)
pub fn add_block(&mut self, block: Block)
Add a loose sub-block to this Block. Mostly used by the parser.
Sourcepub fn add_key_bv(&mut self, key: Token, cmp: Comparator, value: BV)
pub fn add_key_bv(&mut self, key: Token, cmp: Comparator, value: BV)
Add a key = value or key = { ... } field to this Block.
Mostly used by the parser.
Sourcepub fn add_item(&mut self, item: BlockItem)
pub fn add_item(&mut self, item: BlockItem)
Add a BlockItem to this Block.
It can contain any of the variations of things that a Block can hold.
Sourcepub fn add_item_check_tag(&mut self, item: BlockItem)
pub fn add_item_check_tag(&mut self, item: BlockItem)
Add a BlockItem to this Block.
If it is a BlockItem::Block and the previous item is a key = tag,
where the tag is one of a predefined set of strings, then combine
the block with that previous item.
Sourcepub fn append(&mut self, other: &mut Block)
pub fn append(&mut self, other: &mut Block)
Combine two blocks by adding the contents of other to this block.
To avoid lots of cloning, other will be emptied in the process.
Sourcepub fn get_field_value(&self, name: &str) -> Option<&Token>
pub fn get_field_value(&self, name: &str) -> Option<&Token>
Get the value of a single name = value assignment.
Sourcepub fn field_value_is(&self, name: &str, value: &str) -> bool
pub fn field_value_is(&self, name: &str, value: &str) -> bool
Check if name is a field that has the literal string value as its value.
Sourcepub fn get_field_bool(&self, name: &str) -> Option<bool>
pub fn get_field_bool(&self, name: &str) -> Option<bool>
Get the value of a literal boolean field
Sourcepub fn get_field_integer(&self, name: &str) -> Option<i64>
pub fn get_field_integer(&self, name: &str) -> Option<i64>
Get the value of a literal integer field
Sourcepub fn get_field_date(&self, name: &str) -> Option<Date>
pub fn get_field_date(&self, name: &str) -> Option<Date>
Get the value of a literal date field
Sourcepub fn get_field_values(&self, name: &str) -> Vec<&Token>
pub fn get_field_values(&self, name: &str) -> Vec<&Token>
Get all the values of name = value assignments in this block
TODO: should be an iterator
Sourcepub fn get_field_block(&self, name: &str) -> Option<&Block>
pub fn get_field_block(&self, name: &str) -> Option<&Block>
Get the block of a name = { ... } definition
Sourcepub fn get_field_blocks(&self, name: &str) -> Vec<&Block>
pub fn get_field_blocks(&self, name: &str) -> Vec<&Block>
Get all the blocks of name = { ... } definitions in this block
Sourcepub fn get_field_list(&self, name: &str) -> Option<Vec<Token>>
pub fn get_field_list(&self, name: &str) -> Option<Vec<Token>>
Get the values of a single name = { value value ... } list
Sourcepub fn get_multi_field_list(&self, name: &str) -> Vec<Token>
pub fn get_multi_field_list(&self, name: &str) -> Vec<Token>
Get the combined values of any number of name = { value value ... } list
Sourcepub fn get_field(&self, name: &str) -> Option<&BV>
pub fn get_field(&self, name: &str) -> Option<&BV>
Get the value or block on the right-hand side of a field name.
Sourcepub fn get_key(&self, name: &str) -> Option<&Token>
pub fn get_key(&self, name: &str) -> Option<&Token>
Get the key of a field name in the Block. The string value of the key will be equal to
name, but it can be useful to get this key as a Token with its location.
Sourcepub fn get_keys(&self, name: &str) -> Vec<&Token>
pub fn get_keys(&self, name: &str) -> Vec<&Token>
Get all the keys of fields with key name. The string values of these keys will be equal
to name, but it can be useful to get these keys as Token with their locations.
Sourcepub fn has_key(&self, name: &str) -> bool
pub fn has_key(&self, name: &str) -> bool
Return true iff the name occurs in this block at least once as a field key.
pub fn has_key_recursive(&self, name: &str) -> bool
Sourcepub fn count_keys(&self, name: &str) -> usize
pub fn count_keys(&self, name: &str) -> usize
Return the number of times name occurs in this block as a field key.
Sourcepub fn iter_items(&self) -> Iter<'_, BlockItem>
pub fn iter_items(&self) -> Iter<'_, BlockItem>
Return an iterator over the contents of this block.
Sourcepub fn drain(&mut self) -> Drain<'_, BlockItem>
pub fn drain(&mut self) -> Drain<'_, BlockItem>
Return a destructive iterator over the contents of this block.
It will give ownership of the returned BlockItem objects.
Sourcepub fn iter_fields(&self) -> IterFields<'_> ⓘ
pub fn iter_fields(&self) -> IterFields<'_> ⓘ
Return an iterator over all the key = ... fields in this block, ignoring the loose values
and loose blocks.
Sourcepub fn iter_fields_warn(&self) -> IterFields<'_> ⓘ
pub fn iter_fields_warn(&self) -> IterFields<'_> ⓘ
Return an iterator over all the key = ... fields in this block, while warning about loose values
and loose blocks.
Sourcepub fn iter_assignments(&self) -> IterAssignments<'_> ⓘ
pub fn iter_assignments(&self) -> IterAssignments<'_> ⓘ
Return an iterator over all the key = value fields in this block, ignoring other kinds of contents.
Sourcepub fn iter_assignments_warn(&self) -> IterAssignments<'_> ⓘ
pub fn iter_assignments_warn(&self) -> IterAssignments<'_> ⓘ
Return an iterator over all the key = value fields in this block, while warning about
every other kind of content.
Sourcepub fn iter_definitions(&self) -> IterDefinitions<'_> ⓘ
pub fn iter_definitions(&self) -> IterDefinitions<'_> ⓘ
Return an iterator over all the key = { ... } fields in this block, ignoring other kinds of contents.
Sourcepub fn iter_definitions_warn(&self) -> IterDefinitions<'_> ⓘ
pub fn iter_definitions_warn(&self) -> IterDefinitions<'_> ⓘ
Return an iterator over all the key = { ... } fields in this block, while warning about
every other kind of content.
Sourcepub fn iter_assignments_and_definitions(
&self,
) -> IterAssignmentsAndDefinitions<'_> ⓘ
pub fn iter_assignments_and_definitions( &self, ) -> IterAssignmentsAndDefinitions<'_> ⓘ
Return an iterator over all the key = value and key = { ... } fields in this block,
ignoring every other kind of content.
It differs from Block::iter_fields in that it requires the comparator to be =.
Sourcepub fn iter_assignments_and_definitions_warn(
&self,
) -> IterAssignmentsAndDefinitions<'_> ⓘ
pub fn iter_assignments_and_definitions_warn( &self, ) -> IterAssignmentsAndDefinitions<'_> ⓘ
Return an iterator over all the key = value and key = { ... } fields in this block,
while warning about every other kind of content.
It differs from Block::iter_fields_warn in that it requires the comparator to be =.
Sourcepub fn drain_definitions_warn(&mut self) -> DrainDefinitions<'_> ⓘ
pub fn drain_definitions_warn(&mut self) -> DrainDefinitions<'_> ⓘ
Like Block::iter_definitions_warn but it’s a destructive iterator that gives ownership
over the returned definitions.
Sourcepub fn drain_assignments_warn(&mut self) -> DrainAssignments<'_> ⓘ
pub fn drain_assignments_warn(&mut self) -> DrainAssignments<'_> ⓘ
Like Block::iter_assignments_warn but it’s a destructive iterator that gives ownership
over the returned assignments.
Sourcepub fn iter_values(&self) -> IterValues<'_> ⓘ
pub fn iter_values(&self) -> IterValues<'_> ⓘ
Iterate over the loose values in the block.
Sourcepub fn iter_values_warn(&self) -> IterValues<'_> ⓘ
pub fn iter_values_warn(&self) -> IterValues<'_> ⓘ
Iterate over the loose values in the block, while warning about everything else.
Sourcepub fn iter_blocks(&self) -> IterBlocks<'_> ⓘ
pub fn iter_blocks(&self) -> IterBlocks<'_> ⓘ
Iterate over the loose sub-blocks in the block.
Sourcepub fn iter_blocks_warn(&self) -> IterBlocks<'_> ⓘ
pub fn iter_blocks_warn(&self) -> IterBlocks<'_> ⓘ
Iterate over the loose sub-blocks in the block, while warning about everything else.
Sourcepub fn get_field_at_date(&self, name: &str, date: Date) -> Option<&BV>
pub fn get_field_at_date(&self, name: &str, date: Date) -> Option<&BV>
Search through the history fields in this block and return the block or value the
field name would have at the given date. The field value that’s directly in this block,
not in any history block, is considered to be the field value at the beginning of time.
History fields are ones that have a date as the key, like 900.1.1 = { ... }.
Sourcepub fn get_field_value_at_date(&self, name: &str, date: Date) -> Option<&Token>
pub fn get_field_value_at_date(&self, name: &str, date: Date) -> Option<&Token>
Just like Block::get_field_at_date but only for fields that have values (not blocks).
Sourcepub fn macro_parms(&self) -> Vec<&'static str>
pub fn macro_parms(&self) -> Vec<&'static str>
Return a sorted vector of macro parameters taken by this block.
Macro parameters are between $ like $CHARACTER$.
Sourcepub fn expand_macro(
&self,
args: &[(&str, Token)],
loc: Loc,
global: &PdxfileMemory,
) -> Option<Block>
pub fn expand_macro( &self, args: &[(&str, Token)], loc: Loc, global: &PdxfileMemory, ) -> Option<Block>
Expand a block that has macro parameters by substituting arguments for those parameters,
then re-parsing the script, that links the expanded content back to loc.
Sourcepub fn equivalent(&self, other: &Self) -> bool
pub fn equivalent(&self, other: &Self) -> bool
Return true iff this block has the same block items in the same order as other,
including equivalence of blocks inside them.
Sourcepub fn condense_tag(self, tag: &str) -> Self
pub fn condense_tag(self, tag: &str) -> Self
Create a version of this block where the tag is combined with a token that follows it.
Example: color1 = list colorlist becomes color1 = list"colorlist (where the " character
is used as the separator because it can’t show up in normal parsing).
This function is used as a last resort when validating awkward syntax.
Trait Implementations§
Source§impl FileHandler<Block> for CharacterInteractionCategories
impl FileHandler<Block> for CharacterInteractionCategories
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Characters
impl FileHandler<Block> for Characters
Source§fn config(&mut self, config: &Block)
fn config(&mut self, config: &Block)
FileHandler can read settings it needs from the ck3-tiger config.Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Coas
impl FileHandler<Block> for Coas
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for DataBindings
impl FileHandler<Block> for DataBindings
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Decisions
impl FileHandler<Block> for Decisions
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Defines
impl FileHandler<Block> for Defines
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Doctrines
impl FileHandler<Block> for Doctrines
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Effects
impl FileHandler<Block> for Effects
Source§fn config(&mut self, config: &Block)
fn config(&mut self, config: &Block)
FileHandler can read settings it needs from the ck3-tiger config.Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Events
impl FileHandler<Block> for Events
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for GameConcepts
impl FileHandler<Block> for GameConcepts
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Gui
impl FileHandler<Block> for Gui
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, entry: &FileEntry, block: Block)
fn handle_file(&mut self, entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for History
impl FileHandler<Block> for History
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for MenAtArmsTypes
impl FileHandler<Block> for MenAtArmsTypes
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Musics
impl FileHandler<Block> for Musics
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for OnActions
impl FileHandler<Block> for OnActions
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ProvinceHistories
impl FileHandler<Block> for ProvinceHistories
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ProvinceProperties
impl FileHandler<Block> for ProvinceProperties
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ProvinceTerrains
impl FileHandler<Block> for ProvinceTerrains
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ScriptValues
impl FileHandler<Block> for ScriptValues
Source§fn config(&mut self, config: &Block)
fn config(&mut self, config: &Block)
FileHandler can read settings it needs from the ck3-tiger config.Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ScriptedLists
impl FileHandler<Block> for ScriptedLists
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for ScriptedModifiers
impl FileHandler<Block> for ScriptedModifiers
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for TitleHistories
impl FileHandler<Block> for TitleHistories
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Titles
impl FileHandler<Block> for Titles
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Traits
impl FileHandler<Block> for Traits
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Triggers
impl FileHandler<Block> for Triggers
Source§fn config(&mut self, config: &Block)
fn config(&mut self, config: &Block)
FileHandler can read settings it needs from the ck3-tiger config.Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Source§impl FileHandler<Block> for Wars
impl FileHandler<Block> for Wars
Source§fn subpath(&self) -> PathBuf
fn subpath(&self) -> PathBuf
Source§fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
fn load_file(&self, entry: &FileEntry, parser: &ParserMemory) -> Option<Block>
T is returned, it will be passed to handle_file later.
Since load_file is executed multi-threaded while handle_file
is single-threaded, try to do the heavy work in this function.Source§fn handle_file(&mut self, _entry: &FileEntry, block: Block)
fn handle_file(&mut self, _entry: &FileEntry, block: Block)
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.