// AddRule adds a rule in the chain, the default rules are executed first.
//
// returns itself.
336387
func (h *ClientHandler) AddRule(r rule.Rule) *ClientHandler {
	if r == nil {
		return h
	}

	h.rule = rule.Chained(h.rule, r)
	return h
}
1044946
func (i *Index) GetRule(objectID string, opts ...interface{}) (rule Rule, err error) {
	if objectID == "" {
		err = errs.ErrMissingObjectID
		return
	}

	path := i.path("/rules/%s", url.QueryEscape(objectID))
	err = i.transport.Request(&rule, http.MethodGet, path, nil, call.Read, opts...)
	return
}
780154
func (evt *Event) HasRule() bool {
	_, ok := evt.Node.(*ast.Rule)
	return ok
}
210150
func (self *Context) getRule(ruleName ...string) (name string, rule *Rule, found bool) {
	if len(ruleName) == 0 {
		if self.Response == nil {
			return
		}
		name = self.GetRuleName()
	} else {
		name = ruleName[0]
	}
	rule, found = self.spider.GetRule(name)
	return
}
745609
func (p *PacketFilter) AddIPRuleAt(sourceNetwork string, description string, isAllow bool, index int) (*PacketFilterExpression, error) {

	exp := p.createIPRule(sourceNetwork, description, isAllow)
	p.addRuleAt(exp, index)
	return exp, nil
}
279942
func (s *IpRuleItem) SetIpRule(v string) *IpRuleItem {
	s.IpRule = &v
	return s
}
353760
func (s *SetRulePrioritiesOutput) SetRules(v []*Rule) *SetRulePrioritiesOutput {
	s.Rules = v
	return s
}
1267364
func (c *ACLCache) AddRuleList(rules policy.IPRuleList) (err error) {

	for _, rule := range rules {
		if err = c.AddRule(rule); err != nil {
			return
		}
	}

	c.reject.reverseSort()
	c.accept.reverseSort()
	c.observe.reverseSort()
	return
}
309431
func (s *ObjectLockConfiguration) SetRule(v *ObjectLockRule) *ObjectLockConfiguration {
	s.Rule = v
	return s
}
151900
func (s *WebACL) SetRules(v []*ActivatedRule) *WebACL {
	s.Rules = v
	return s
}
1244542
func (s *ListTargetsByRuleInput) SetRule(v string) *ListTargetsByRuleInput {
	s.Rule = &v
	return s
}
499446
func FindRule(key string) *Rule {
	collections.ruleMutex.Lock()
	defer collections.ruleMutex.Unlock()

	obj := collections.rules[key]
	if obj == nil {
		return nil
	}

	return obj
}
905873
func (s *UpdateReceiptRuleInput) SetRule(v *ReceiptRule) *UpdateReceiptRuleInput {
	s.Rule = v
	return s
}
1233905
func (s *DescribeReceiptRuleOutput) SetRule(v *ReceiptRule) *DescribeReceiptRuleOutput {
	s.Rule = v
	return s
}
1007353
func (s *ModifyRuleOutput) SetRules(v []*Rule) *ModifyRuleOutput {
	s.Rules = v
	return s
}
891606
func (rs *RuleSet) Add(rule *Rule) {
	for _, exist := range *rs {
		if exist.Equal(rule) {
			return
		}
	}
	*rs = append(*rs, rule)
}
882790
func (s *GetRuleOutput) SetRule(v *Rule) *GetRuleOutput {
	s.Rule = v
	return s
}