1MooseX::Meta::TypeConstUrsaeirntC:o:nSttrriubcuttMueordoesdPe(eX3r:)l:MDeotcau:m:eTnytpaetCioonnstraint::Structured(3)
2
3
4
6 MooseX::Meta::TypeConstraint::Structured -
7 MooseX::Meta::TypeConstraint::Structured - Structured type constraints.
8
10 A structure is a set of Moose::Meta::TypeConstraint that are
11 'aggregated' in such a way as that they are all applied to an incoming
12 list of arguments. The idea here is that a Type Constraint could be
13 something like, "An Int followed by an Int and then a Str" and that
14 this could be done so with a declaration like:
15
16 Tuple[Int,Int,Str]; ## Example syntax
17
18 So a structure is a list of Type constraints (the "Int,Int,Str" in the
19 above example) which are intended to function together.
20
22 type_constraints
23 A list of Moose::Meta::TypeConstraint objects.
24
25 constraint_generator
26 A subref or closure that contains the way we validate incoming values
27 against a set of type constraints.
28
30 validate
31 Messing with validate so that we can support niced error messages.
32
33 generate_constraint_for ($type_constraints)
34 Given some type constraints, use them to generate validation rules for
35 an ref of values (to be passed at check time)
36
37 parameterize (@type_constraints)
38 Given a ref of type constraints, create a structured type.
39
40 __infer_constraint_generator
41 This returns a CODEREF which generates a suitable constraint generator.
42 Not user servicable, you'll never call this directly.
43
44 compile_type_constraint
45 hook into compile_type_constraint so we can set the correct validation
46 rules.
47
48 create_child_type
49 modifier to make sure we get the constraint_generator
50
51 is_a_type_of
52 is_subtype_of
53 equals
54 Override the base class behavior.
55
56 type_constraints_equals
57 Checks to see if the internal type constraints are equal.
58
59 get_message
60 Give you a better peek into what's causing the error. For now we
61 stringify the incoming deep value with Devel::PartialDump and pass that
62 on to either your custom error message or the default one. In the
63 future we'll try to provide a more complete stack trace of the actual
64 offending elements
65
67 The following modules or resources may be of interest.
68
69 Moose, Moose::Meta::TypeConstraint
70
72 · John Napiorkowski <jjnapiork@cpan.org>
73
74 · Florian Ragwitz <rafl@debian.org>
75
76 · Yuval Kogman <nothingmuch@woobling.org>
77
78 · Tomas Doran <bobtfish@bobtfish.net>
79
80 · Robert Sedlacek <rs@474.at>
81
83 This software is copyright (c) 2011 by John Napiorkowski.
84
85 This is free software; you can redistribute it and/or modify it under
86 the same terms as the Perl 5 programming language system itself.
87
88
89
90perl v5.12.4 20M1o1o-s1e0X-:0:3Meta::TypeConstraint::Structured(3)