def describe(self, name=str(), **options):
        """ Returns the **metadata** of the `Structure` as an
        :class:`ordered dictionary <collections.OrderedDict>`.

        .. code-block:: python

            metadata = {
                'class': self.__class__.__name__,
                'name': name if name else self.__class__.__name__,
                'size': len(self),
                'type': Structure.item_type.name
                'member': [
                    item.describe(member) for member, item in self.items()
                ]
            }

        :param str name: optional name for the `Structure`.
            Fallback is the class name.
        :keyword bool nested: if ``True`` all :class:`Pointer` fields of the
            `Structure` lists their referenced :attr:`~Pointer.data` object fields
            as well (chained method call). Default is ``True``.
        """
        members = list()
        metadata = OrderedDict()
        metadata['class'] = self.__class__.__name__
        metadata['name'] = name if name else self.__class__.__name__
        metadata['size'] = len(self)
        metadata['type'] = self.item_type.name
        metadata['member'] = members

        for member_name, item in self.items():
            # Container
            if is_container(item):
                members.append(item.describe(member_name, **options))
            # Pointer
            elif is_pointer(item) and get_nested(options):
                members.append(item.describe(member_name, **options))
            # Field
            elif is_field(item):
                members.append(item.describe(member_name, nested=False))
            else:
                raise MemberTypeError(self, item, member_name)
        return metadata
def describe ( self , name = str ( ) , ** options ) : members = list ( ) metadata = OrderedDict ( ) metadata [ 'class' ] = self . __class__ . __name__ metadata [ 'name' ] = name if name else self . __class__ . __name__ metadata [ 'size' ] = len ( self ) metadata [ 'type' ] = self . item_type . name metadata [ 'member' ] = members for member_name , item in self . items ( ) : if is_container ( item ) : members . append ( item . describe ( member_name , ** options ) ) elif is_pointer ( item ) and get_nested ( options ) : members . append ( item . describe ( member_name , ** options ) ) elif is_field ( item ) : members . append ( item . describe ( member_name , nested = False ) ) else : raise MemberTypeError ( self , item , member_name ) return metadata
Returns the **metadata** of the `Structure` as an
        :class:`ordered dictionary <collections.OrderedDict>`.

        .. code-block:: python

            metadata = {
                'class': self.__class__.__name__,
                'name': name if name else self.__class__.__name__,
                'size': len(self),
                'type': Structure.item_type.name
                'member': [
                    item.describe(member) for member, item in self.items()
                ]
            }

        :param str name: optional name for the `Structure`.
            Fallback is the class name.
        :keyword bool nested: if ``True`` all :class:`Pointer` fields of the
            `Structure` lists their referenced :attr:`~Pointer.data` object fields
            as well (chained method call). Default is ``True``.