Sub::Meta::Type - type constraints for Sub::Meta
my $submeta = Sub::Meta->new( subname => 'hello', ); my $type = Sub::Meta::Type->new( submeta => $submeta, submeta_strict_check => !!0, find_submeta => \&Sub::Meta::CreatorFunction::find_submeta, ); sub hello {} my $meta = $type->coerce(\&hello); $type->check($meta)
This module provides types for Sub::Meta.
method submeta() => InstanceOf[Sub::Meta]
Accessor for Sub::Meta.
method submeta_strict_check() => Bool
Whether Sub::Meta::Type check by is_strict_same_interface or not. If false, then check by is_relaxed_same_interface.
is_strict_same_interface
is_relaxed_same_interface
method find_submeta() => CodeRef[ Ref['CODE'] => Maybe[InstanceOf[Sub::Meta]] ]
Code reference for finding Sub::Meta from a subroutine like Sub::Meta::CreatorFunction::find_submeta
Sub::Meta::CreatorFunction::find_submeta
method get_detail_message(InstanceOf['Sub::Meta'] $submeta) => Str
Returns the detailed reason for the error message for a value; even if the value passes the type constraint. This method is used inside Type#get_message and TypeSub#get_message.
Type#get_message
TypeSub#get_message
Types::Sub, Sub::Meta::TypeSub
Copyright (C) kfly8.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
kfly8 <kfly@cpan.org>
To install Sub::Meta, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::Meta
CPAN shell
perl -MCPAN -e shell install Sub::Meta
For more information on module installation, please visit the detailed CPAN module installation guide.