{
    "content": [
        {
            "type": "text",
            "text": "# Specio::Constraint::Structurable (perldoc)\n\n## NAME\n\nSpecio::Constraint::Structurable - A class which represents structurable constraints\n\n## SYNOPSIS\n\nmy $tuple = t('Tuple');\nmy $tupleofstrint = $tuple->parameterize( of => [ t('Str'), t('Int') ] );\n\n## DESCRIPTION\n\nThis class implements the API for structurable types like \"Dict\", \"Map\"< and \"Tuple\".\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **API**\n- **SUPPORT**\n- **SOURCE**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Specio::Constraint::Structurable",
        "section": "",
        "mode": "perldoc",
        "summary": "Specio::Constraint::Structurable - A class which represents structurable constraints",
        "synopsis": "my $tuple = t('Tuple');\nmy $tupleofstrint = $tuple->parameterize( of => [ t('Str'), t('Int') ] );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "API",
                "lines": 65,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Specio::Constraint::Structurable - A class which represents structurable constraints\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.47\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my $tuple = t('Tuple');\n\nmy $tupleofstrint = $tuple->parameterize( of => [ t('Str'), t('Int') ] );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class implements the API for structurable types like \"Dict\", \"Map\"< and \"Tuple\".\n",
                "subsections": []
            },
            "API": {
                "content": "This class implements the same API as Specio::Constraint::Simple, with a few additions.\n\nSpecio::Constraint::Structurable->new(...)\nThis class's constructor accepts two additional parameters:\n\n*   parameterizationargsbuilder\n\nThis is a subroutine that takes the values passed to \"of\" and returns a hash of named\narguments. These arguments will then be passed into the \"structuredconstraintgenerator\" or\n\"structuredinlinegenerator\".\n\nThis should also do argument checking to make sure that the argument passed are valid. For\nexample, the \"Tuple\" type turns the arrayref passed to \"of\" into a hash, along the way\nchecking that the caller did not do things like interleave optional and required elements or\nmix optional and slurpy together in the definition.\n\nThis parameter is required.\n\n*   namebuilder\n\nThis is a subroutine that is called to generate a name for the structured type when it is\ncreated. This will be called as a method on the \"Specio::Constraint::Structurable\" object.\nIt will be passed the hash of arguments returned by the \"parameterizationargsbuilder\".\n\nThis parameter is required.\n\n*   structuredconstraintgenerator\n\nThis is a subroutine that generates a new constraint subroutine when the type is structured.\n\nIt will be called as a method on the type and will be passed the hash of arguments returned\nby the \"parameterizationargsbuilder\".\n\nThis parameter is mutually exclusive with the \"structuredinlinegenerator\" parameter.\n\nThis parameter or the \"structuredinlinegenerator\" parameter is required.\n\n*   structuredinlinegenerator\n\nThis is a subroutine that generates a new inline generator subroutine when the type is\nstructured.\n\nIt will be called as a method on the Specio::Constraint::Structured object when that object\nneeds to generate an inline constraint. It will receive the type parameter as the first\nargument and the variable name as a string as the second.\n\nThe remaining arguments will be the parameter hash returned by the\n\"parameterizationargsbuilder\".\n\nThis probably seems fairly confusing, so looking at the examples in the\nSpecio::Library::Structured::* code may be helpful.\n\nThis parameter is mutually exclusive with the \"structuredconstraintgenerator\" parameter.\n\nThis parameter or the \"structuredconstraintgenerator\" parameter is required.\n\n$type->parameterize(...)\nThis method takes two arguments. The \"of\" argument should be an object which does the\nSpecio::Constraint::Role::Interface role, and is required.\n\nThe other argument, \"declaredat\", is optional. If it is not given, then a new\nSpecio::DeclaredAt object is creating using a call stack depth of 1.\n\nThis method returns a new Specio::Constraint::Structured object.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs may be submitted at <https://github.com/houseabsolute/Specio/issues>.\n\nI am also usually active on IRC as 'autarch' on \"irc://irc.perl.org\".\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "The source code repository for Specio can be found at <https://github.com/houseabsolute/Specio>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Dave Rolsky <autarch@urth.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2012 - 2021 by Dave Rolsky.\n\nThis is free software, licensed under:\n\nThe Artistic License 2.0 (GPL Compatible)\n\nThe full text of the license can be found in the LICENSE file included with this distribution.\n",
                "subsections": []
            }
        }
    }
}