func (f *Filter) ToV2() *v2acl.HeaderFilter {
	if f == nil {
		return nil
	}
	filter := new(v2acl.HeaderFilter)
	filter.SetValue(f.value.String())
	filter.SetKey(f.key.String())
	filter.SetMatchType(f.matcher.ToV2())
	filter.SetHeaderType(f.from.ToV2())
	return filter
}
ToV2 converts Filter to v2 acl.EACLRecord.Filter message.

Nil Filter converts to nil.
package eacl
import (
	"fmt"
	"strconv"
	v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl"
)
type Filter struct {
	from    FilterHeaderType
	matcher Match
	key     filterKey
	value   fmt.Stringer
}
type staticStringer string
type u64Stringer uint64
type filterKey struct {
	typ filterKeyType
	str string
}
type filterKeyType int
const (
	_ filterKeyType = iota
	fKeyObjVersion
	fKeyObjID
	fKeyObjContainerID
	fKeyObjOwnerID
	fKeyObjCreationEpoch
	fKeyObjPayloadLength
	fKeyObjPayloadHash
	fKeyObjType
	fKeyObjHomomorphicHash
)
func (s staticStringer) String() string {
	return string(s)
}
func (u u64Stringer) String() string {
	return strconv.FormatUint(uint64(u), 10)
}
func (f Filter) Value() string {
	return f.value.String()
}
func (f Filter) Matcher() Match {
	return f.matcher
}
func (f Filter) Key() string {
	return f.key.String()
}
func (f Filter) From() FilterHeaderType {
	return f.from
}