'Encode a single field.
:param str name: Name of the field to be encoded.
:raises errors.SerializationError: if field cannot be serialized
:raises errors.Error: if field could not be found'

def encode(self, name):

    try:
        field = self._fields[name]
    except KeyError:
        raise errors.Error('Field    not    found:    {0}'.format(name))
    return field.encode(getattr(self, name))
