async def variant(self, elem=None, elem_type=None, params=None):
elem_type = elem_type if elem_type else elem.__class__<EOL>version = await self.version(elem_type, params, elem=elem)<EOL>if self.is_tracked():<EOL><INDENT>return self.get_tracked()<EOL><DEDENT>if hasattr(elem_type, '<STR_LIT>'):<EOL><INDENT>elem = elem_type() if elem is None else elem<EOL>self.pop_track()<EOL>return await elem.boost_serialize(self, elem=elem, elem_type=elem_type, params=params, version=version)<EOL><DEDENT>if self.writing:<EOL><INDENT>self.pop_track()<EOL>return await self.dump_variant(elem=elem,<EOL>elem_type=elem_type if elem_type else elem.__class__, params=params)<EOL><DEDENT>else:<EOL><INDENT>obj = await self.load_variant(elem_type=elem_type if elem_type else elem.__class__,<EOL>params=params, elem=elem)<EOL>return self.track_obj(obj)<EOL><DEDENT>
Loads/dumps variant type
:param elem:
:param elem_type:
:param params:
:return: