Function il2_iltags::tags::tag_id_downcast_mut[][src]

pub fn tag_id_downcast_mut<T: ILTag + Any>(
    tag_id: u64,
    tag: &mut dyn ILTag
) -> Result<&mut T>
Expand description

Downcasts a ILTag to its concrete type as a mutable reference. It fails if the tag id or the concrete type does not match.

Arguments:

  • tag_id: The expected tag id;
  • tag: The tag to be downcast;

Returns: An option with a reference to the concrete type or None if the conversion is not possible.