def matches_constraint(constraint, linelist, linedict):
    """Return True if all constraints are marched

    Args:
        constraint (dict|None): combined constraints
        linelist (list): List of line fields
        linedict (dict): Dictionary with structured elements

    Returns:
        bool: True is all constraints are matched, False otherwise

    """
    if constraint is None:
        return True
    # if constraint is not None, it will always have "fields" and "keys"
    if constraint["fields"]:
        try:
            if not all(linelist[i] == v for i, v in constraint["fields"]):
                return False
        except IndexError:
            # In case records have variable number of fields (change in the log format)
            return False
    if constraint["keys"]:
        try:
            if not all(linedict[k] == v for k, v in constraint["keys"]):
                return False
        except KeyError:
            # Some records may have keys not present in others. Only positive matches are True
            return False
    return True