Function il2_iltags::tags::tag_id_downcast_ref[][src]

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

Downcasts a ILTag to its concrete type. 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:

  • Ok(v): ;
  • Err(ErrorKind::UnexpectedTagType): If the conversion is not possible;