Moose::Meta::TypeConstraint::Registry(3) User Contributed Perl Documentation Moose::Meta::TypeConstraint::Registry(3)

# [DESCRIPTION](#DESCRIPTION)

This class is a registry that maps type constraint names to Moose::Meta::TypeConstraint objects.

Currently, it is only used internally by Moose::Util::TypeConstraints, which creates a single global registry.

# [INHERITANCE](#INHERITANCE)

"Moose::Meta::TypeConstraint::Registry" is a subclass of Class::MOP::Object.

# [METHODS](#METHODS)

## [Moose::Meta::TypeConstraint::Registry-&gt;new(%options)](#Moose::Meta::TypeConstraint::Registry)

This creates a new registry object based on the provided %options:

- parent\_registry
  
  This is an optional Moose::Meta::TypeConstraint::Registry object.
- type\_constraints
  
  This is hash reference of type names to type objects. This is optional. Constraints can be added to the registry after it is created.

## [$registry-&gt;get\_parent\_registry](#$registry)

Returns the registry's parent registry, if it has one.

## [$registry-&gt;has\_parent\_registry](#$registry~2)

Returns true if the registry has a parent.

## [$registry-&gt;set\_parent\_registry($registry)](#$registry~3)

Sets the parent registry.

## [$registry-&gt;get\_type\_constraint($type\_name)](#$registry~4)

This returns the Moose::Meta::TypeConstraint object from the registry for the given name, if one exists.

## [$registry-&gt;has\_type\_constraint($type\_name)](#$registry~5)

Returns true if the registry has a type of the given name.

## [$registry-&gt;add\_type\_constraint($type)](#$registry~6)

Adds a new Moose::Meta::TypeConstraint object to the registry.

## [$registry-&gt;find\_type\_constraint($type\_name)](#$registry~7)

This method looks in the current registry for the named type. If the type is not found, then this method will look in the registry's parent, if it has one.

# [BUGS](#BUGS)

See "BUGS" in Moose for details on reporting bugs.

2026-08-29 perl v5.44.0

---

Document: Moose::Meta::TypeConstraint::Registry(3pm) from perl-moose 2.4000-r4 (Chainguard OS)
Source: https://github.com/moose/Moose
