Moose::...Registry(3)
π Moose::Meta::TypeConstraint::Registry β the registry for type constraints π
okay bestie, so this is a page from the User Contributed Perl Documentation, and yes it's literally called Moose::Meta::TypeConstraint::Registry and it's giving very organized little librarian energy. let's get into it π«Ά
β¨ VERSION β¨
this is version 2.4000. slay. π
πΈ DESCRIPTION πΈ
so basically this class is a registry β and what does a registry do? it maps type constraint names to Moose::Meta::TypeConstraint objects. that's it. that's the whole vibe. name goes in, type object comes out. π
and rn it's only used internally by Moose::Util::TypeConstraints, which is the thing that creates a single global registry. so like, one big registry for everyone. no cap.
π¦ INHERITANCE π¦
Moose::Meta::TypeConstraint::Registry is a subclass of Class::MOP::Object. family tree icon behavior, we love to see it π
π METHODS π
Moose::Meta::TypeConstraint::Registry->new(%options)
this is the constructor, bestie. it makes a brand new registry object based on the %options you hand it:
parent_registryβ this one is optional. it's aMoose::Meta::TypeConstraint::Registryobject. your registry's registry parent, if you will. generational. πtype_constraintsβ this is a hash reference that maps type names to type objects. also optional! you can just add constraints to the registry later, after it already exists. no pressure, no rush. β¨
$registry->get_parent_registry
returns the registry's parent registry, if it has one. if it doesn't... well. π
$registry->has_parent_registry
returns true if the registry has a parent. simple as that. vibe check passed β
$registry->set_parent_registry($registry)
sets the parent registry. boom. done. π
$registry->get_type_constraint($type_name)
this returns the Moose::Meta::TypeConstraint object from the registry for the given name β if one exists. iykyk π
$registry->has_type_constraint($type_name)
returns true if the registry has a type with the given name. yes or no, no in-between, very decisive of it. π
$registry->add_type_constraint($type)
adds a new Moose::Meta::TypeConstraint object to the registry. new type just dropped π₯
$registry->find_type_constraint($type_name)
okay this one is the main character method. it looks in the current registry for the named type. and if the type isn't found there? it goes and looks in the registry's parent, if it has one. it's literally searching the family tree for you π so thoughtful.
π BUGS π
see "BUGS" in Moose for the details on reporting bugs. go tell them, not me. π
π AUTHORS π
these iconic legends made this happen:
- Stevan Little
<stevan@cpan.org> - Dave Rolsky
<autarch@urth.org> - Jesse Luehrs
<doy@cpan.org> - Shawn M Moore
<sartak@cpan.org> - ΧΧΧΧ Χ§ΧΧ'ΧΧ (Yuval Kogman)
<nothingmuch@woobling.org> - Karen Etheridge
<ether@cpan.org> - Florian Ragwitz
<rafl@debian.org> - Hans Dieter Pearcey
<hdp@cpan.org> - Chris Prather
<chris@prather.org> - Matt S Trout
<mstrout@cpan.org>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2006 by Infinity Interactive, Inc.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, go wild, it's free π
and that's the whole page bestie!! this was rendered forperl v5.42.0on2025-07-25β literally, the manual pageMoose::...Registry(3)said so at the bottom and i would never gatekeep that from you π«Άβ¨π
π¦ where this page comes from
- fedora 43: perl-Moose 2.4000-4.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms