MooseX...ctured(3pm)
β¨ NAME β¨
Okay bestie, welcome to the group chat for MooseX::Meta::TypeConstraint::Structured β structured type constraints. The manual page is MooseX...ctured(3pm), and itβs from User Contributed Perl Documentation. π
π VERSION π
version 0.36, periodt. Thatβs the version. β¨
π¦ DESCRIPTION π¦
Okay so a structure is a set of Moose::Meta::TypeConstraint that are 'aggregated' in such a way as that they are all applied to an incoming list of arguments. Highkey the whole idea is that a Type Constraint could be something like, βAn Int followed by an Int and then a Strβ β and that this could be done so with a declaration like:
Tuple[Int,Int,Str]; ## Example syntax
So a structure is a list of type constraints (the Int,Int,Str in the above example) which are intended to function together. Slay.
π ATTRIBUTES π
type_constraintsβ a list ofMoose::Meta::TypeConstraintobjects. Iconic.constraint_generatorβ this one is listed as an attribute, and in the page right here it has no inline description attached. No extra lore in this exact spot, bestie.
πΈ METHODS πΈ
validateβ messing withvalidateso that we can support nicer error messages. We love nicer errors.generate_constraint_for ($type_constraints)β given some type constraints, use them to generate validation rules for an ref of values (to be passed at check time). Fr fr.parameterize (@type_constraints)β given a ref of type constraints, create a structured type. Main character energy.__infer_constraint_generatorβ listed with no extra description right here. Keep scrolling, thereβs a floating CODEREF line later.compile_type_constraintβ hook intocompile_type_constraintso we can set the correct validation rules. Love that for us.create_child_typeβ modifier to make sure we get theconstraint_generator. Yup yup.is_a_type_ofβ listed with no extra description in the page. Just vibes.is_subtype_ofβ also listed with no extra description in the page. Still vibes.equalsβ override the base class behavior. Periodt.type_constraints_equalsβ checks to see if the internal type constraints are equal. Neat.get_messageβ give you a better peek into what's causing the error. For now we stringify the incoming deep value withDevel::PartialDumpand pass that on to either your custom error message or the default one. In the future we'll try to provide a more complete stack trace of the actual offending elements π
Then, right after that get_message blurb, the page has these two floating paragraphs with no extra method heading β Iβm not hiding them, bestie: A subref or closure that contains the way we validate incoming values against a set of type constraints. This returns a CODEREF which generates a suitable constraint generator. Not user servicable, you'll never call this directly.
π₯ SEE ALSO π₯
The following modules or resources may be of interest.
MooseMoose::Meta::TypeConstraint
π«Ά SUPPORT π«Ά
Got a bug? Spill it to the RT bug tracker. Bugs may be submitted through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Structured> (or bug-MooseX-Types-Structured@rt.cpan.org / <mailto:bug-MooseX-Types-Structured@rt.cpan.org>). π
There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/moose.html>. Join the chat.
There is also an irc channel available for users of this distribution, at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>. iykyk.
π AUTHORS π
John Napiorkowski <jjnapiork@cpan.org>Florian Ragwitz <rafl@debian.org>ΧΧΧΧ Χ§ΧΧ'ΧΧ (Yuval Kogman) <nothingmuch@woobling.org>Tomas (t0m) Doran <bobtfish@bobtfish.net>Robert Sedlacek <rs@474.at>
Legends, all of them. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2008 by John Napiorkowski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Thatβs the legal tea, slay.
xoxo, bestie β the footer says this page is from perl v5.42.0, dated 2017-05-10, and its manual name is MooseX...ctured(3pm). π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-MooseX-Types-Structured 0.36-bp160.1.11 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms