Function il2_iltags::tags::util::iltag_clone_with_factory[][src]

pub fn iltag_clone_with_factory(
    factory: &dyn ILTagFactory,
    tag: &dyn ILTag
) -> Result<Box<dyn ILTag>>
Expand description

Clones the given tag using a serialization/deserialization process.

It is not the most efficient way to perform the cloning but it allows the cloning of any tag, regardless of how it is implemented.

It is important to notice that the cloned tag may not share the same implementation of the cloned tag as the resulting tag will be implemented by the tag created by the specified factory for the source tag id.

Arguments:

  • factory: The tag factory to be used;
  • tag: The tag to be cloned;

Returns:

  • Ok(tag): The cloned tag;
  • Err(_): If the cloning process fails;