| MooseX-Types documentation | view source | Contained in the MooseX-Types distribution. |
MooseX::Types::Util - Common utility functions for the distribution
version 0.27
This package the exportable functions that many parts in MooseX::Types might need.
TypeConstraint | Undef = has_available_type_export($package, $name);
This function allows you to introspect if a given type export is available
at this point in time. This means that the $package must have imported
a typeconstraint with the name $name, and it must be still in its symbol
table.
Two arguments are expected:
The name of the package to introspect.
The name of the type export to introspect.
Note that the $name is the exported name of the type, not the declared
one. This means that if you use Sub::Exporters functionality to rename an import
like this:
use MyTypes Str => { -as => 'MyStr' };
you would have to introspect this type like this:
has_available_type_export $package, 'MyStr';
The return value will be either the type constraint that belongs to the export or an undefined value.
This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.
Robert "phaylon" Sedlacek <rs@474.at>
This software is copyright (c) 2011 by Robert "phaylon" Sedlacek.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| MooseX-Types documentation | view source | Contained in the MooseX-Types distribution. |