perldoc > Moose::Meta::TypeConstraint

📛 NAME

Moose::Meta::TypeConstraint - The Moose Type Constraint metaclass

🚀 Quick Reference

Use CaseCommandDescription
📦 Create a new type constraintMoose::Meta::TypeConstraint->new(%options)Create a type constraint with name, parent, constraint sub, message, coercion, inlining
🔍 Check if value is valid$constraint->check($value)Returns true if value passes constraint
🔄 Coerce a value$constraint->coerce($value)Attempt to coerce value to type; returns original if no coercion applies
✅ Validate and return message$constraint->validate($value)Returns explicit undef if valid, or error message generated by get_message
🚨 Assert valid or throw$constraint->assert_valid($value)Returns true if valid, throws exception with message otherwise
🧬 Check subtype relationship$constraint->is_subtype_of($type)Returns true if given type is a parent of current type
🔗 Get parent type$constraint->parentReturns parent type constraint object, if any
📝 Get constraint subroutine$constraint->constraintReturns the subroutine that implements the constraint check
🏗️ Create child type$constraint->create_child_type(%options)Returns new type constraint of same class, with this as parent

🏷️ VERSION

version 2.2200

📖 DESCRIPTION

This class represents a single type constraint. Moose's built-in type constraints, as well as constraints you define, are all stored in a Moose::Meta::TypeConstraint::Registry object as objects of this class.

🧬 INHERITANCE

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

⚙️ METHODS

🐛 BUGS

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

👥 AUTHORS

⚖️ 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.

Moose::Meta::TypeConstraint
📛 NAME 🚀 Quick Reference 🏷️ VERSION 📖 DESCRIPTION 🧬 INHERITANCE ⚙️ METHODS 🐛 BUGS 👥 AUTHORS ⚖️ COPYRIGHT AND LICENSE

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-28 07:18 @216.73.217.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^