func (r *Rule) Apply(ctx routing.Context) bool {
	return r.Condition.Apply(ctx)
}
Apply checks rule matching of current routing context.
package router
import (
	"context"
	"encoding/json"
	"github.com/golang/protobuf/jsonpb"
	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
	"github.com/v2fly/v2ray-core/v4/common/net"
	"github.com/v2fly/v2ray-core/v4/common/serial"
	"github.com/v2fly/v2ray-core/v4/features/outbound"
	"github.com/v2fly/v2ray-core/v4/features/routing"
	"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
)
type Rule struct {
	Tag       string
	Balancer  *Balancer
	Condition Condition
}
func (r *Rule) GetTag() (string, error) {
	if r.Balancer != nil {
		return r.Balancer.PickOutbound()
	}
	return r.Tag, nil
}