# man > Type::Tiny::XS(3pm)

## NAME
    [Type::Tiny::XS](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS/markdown) - provides an XS boost for some of [Type::Tiny](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny/markdown)'s built-in type constraints

## SYNOPSIS
       use [Types::Standard](https://www.chedong.com/phpMan.php/perldoc/Types%3A%3AStandard/markdown) qw(Int);

## DESCRIPTION
    This module is optionally used by [Type::Tiny](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny/markdown) 0.045_03 and above to provide faster, C-based
    implementations of some type constraints. (This package has only core dependencies, and does not
    depend on [Type::Tiny](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny/markdown), so other data validation frameworks might also consider using it!)

    Only the following three functions should be considered part of the supported API:

    [Type::Tiny::XS::get_coderef_for](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS%3A%3Agetcodereffor/markdown)($type)
        Given a supported type constraint name, such as "Int", returns a coderef that can be used to
        validate a parameter against this constraint.

        Returns undef if this module cannot provide a suitable coderef.

    [Type::Tiny::XS::get_subname_for](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS%3A%3Agetsubnamefor/markdown)($type)
        Like "get_coderef_for" but returns the name of such a sub as a string.

        Returns undef if this module cannot provide a suitable sub name.

    [Type::Tiny::XS::is_known](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS%3A%3Aisknown/markdown)($coderef)
        Returns true if the coderef was provided by [Type::Tiny::XS](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS/markdown).

    In addition to the above functions, the subs returned by "get_coderef_for" and "get_subname_for"
    are considered part of the "supported API", but only for the lifetime of the Perl process that
    returned them.

    To clarify, if you call get_subname_for("ArrayRef[Int]") in a script, this will return the name
    of a sub. That sub (which can be used to validate arrayrefs of integers) is now considered part
    of the supported API of [Type::Tiny::XS](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny%3A%3AXS/markdown) until the script finishes running. Next time the script
    runs, there is no guarantee that the sub will continue to exist, or continue to do the same
    thing.

## BUGS
    Please report any bugs to <<http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny-XS>>.

## SEE ALSO
    [Type::Tiny](https://www.chedong.com/phpMan.php/perldoc/Type%3A%3ATiny/markdown), [Types::Standard](https://www.chedong.com/phpMan.php/perldoc/Types%3A%3AStandard/markdown).

## AUTHOR
    Toby Inkster <<tobyink@cpan.org>> forked all this from [Mouse::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Mouse%3A%3AUtil%3A%3ATypeConstraints/markdown).

    ArrayLike, HashLike, CodeLike, and StringLike constraints based on code by ikegami on
    StackOverflow.

    <<https://stackoverflow.com/a/64019481/1990570>>.

## COPYRIGHT AND LICENCE
    This software is copyright (c) 2014, 2018-2020 by Toby Inkster.

    This is free software; you can redistribute it and/or modify it under the same terms as the Perl
    5 programming language system itself.

## DISCLAIMER OF WARRANTIES
    THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
    PURPOSE.

