import ctypes


def struct_pack(structure):
	"""
	Pack a :py:class:`ctypes.Structure` object and convert it to a packed string.

	:param structure: The structure instance to convert
	:type structure: :py:class:`ctypes.Structure`
	:return: The structure instance converted to a string.
	:rtype: str
	"""
	return ctypes.string_at(ctypes.byref(structure), ctypes.sizeof(structure))