Struct il2_iltags::tags::ILTagCreatorEngine [−][src]
pub struct ILTagCreatorEngine { /* fields omitted */ }
Expand description
This struct implements an engine that maps the ILTagCreators to the associated tag ID. It can be used as a component to implement ILTagFactory trait.
Implementations
Creates a new instance of the ILTagCreatorEngine.
Arguments:
strict
: Strict mode. If false, unknown tags will be mapped to RawTag instances.
pub fn register(
&mut self,
tag_id: u64,
creator: Box<dyn ILTagCreator>
) -> Option<Box<dyn ILTagCreator>>
pub fn register(
&mut self,
tag_id: u64,
creator: Box<dyn ILTagCreator>
) -> Option<Box<dyn ILTagCreator>>
Registers a new ILTagCreator.
Arguments:
tag_id
: The tag id;creator
: The new creator;
Returns:
Some<Box<dyn ILTagCreator>>
: The previously registered creator for the specified id;None
: If the id is not associated with a new creator;
Deregisters a ILTagCreator.
Arguments:
tag_id
: The tag id;
Returns:
Some<Box<dyn ILTagCreator>>
: The previously registered creator for the specified id;None
: If the id is not associated with a new creator;
Creates a new empty tag for the given id. It uses the registered creators to perform the operation.
Arguments:
tag_id
: The tag id;
Returns:
Some<Box<dyn ILTag>>
: The new empty tag instance;None
: If the tag id is unknown (only if strict mode is enabled);