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 a Moose::Meta::TypeConstraint::Registry object. 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>

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 for perl v5.42.0 on 2025-07-25 β€” literally, the manual page Moose::...Registry(3) said so at the bottom and i would never gatekeep that from you πŸ«Άβœ¨πŸ’…
πŸ“¦ where this page comes from