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 of Moose::Meta::TypeConstraint objects. 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 with validate so 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 into compile_type_constraint so we can set the correct validation rules. Love that for us.
  • create_child_type β€” modifier to make sure we get the constraint_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 with Devel::PartialDump and 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.

  • Moose
  • Moose::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. πŸ‘‘

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