Types::URI(3pm)
π Types::URI π
ok bestie, so this is Types::URI (that's the 3pm one, from the User Contributed Perl Documentation section β very demure, very CPAN). it's all about type constraints and coercions for URIs, and honestly? it's giving β¨structured dataβ¨.
πΈ NAME πΈ
Types::URI β type constraints and coercions for URIs π¦
β¨ SYNOPSIS β¨
ok so picture this, you're writing a package and you want an attribute that's definitely a URI, no discussion:
package FroobleDocument;
use Moose;
use Types::URI -all;
has source => (
is => 'ro',
isa => Uri,
coerce => 1,
);
like. that's it. that's the whole vibe. Uri as the isa, coerce => 1 on, and your source attribute is now contractually obligated to be a URI. periodt π
π DESCRIPTION π
Types::URI is a type constraint library β and it's built for hanging out with Moo/Moose attributes, Kavorka sub signatures, and all the other cool kids, so forth, etc. π«Ά
π Types π
this module serves up some type constraints that are broadly compatible with the ones MooseX::Types::URI gives you, plus a couple of extra type constraints of its own, because it's generous like that. π
β Uri
a class type for URI/URI::WithBase. here's everything it can coerce from:
- from
Uuidβ coerces to a URI in theurn:uuid:schema. (See Types::UUID.) - from
Strβ usesnewinURI. - from
Pathβ usesnewinURI::file. (See Types::Path::Tiny.) - from
ScalarRefβ usesnewinURI::data. - from
HashRefβ coerces using URI::FromHash. - from
Iriβ usesnewinURI. - from
RDF::Trine::Node::Resource,RDF::Trine::Namespace,XML::Namespaceβ usesnewinURI.
π¦ FileUri
a subtype of Uri that covers URI::file. π here's what it eats:
- from
Strβ usesnewinURI::file. - from
Pathβ usesnewinURI::file. (See Types::Path::Tiny.) - from
HashRefβ coerces using URI::FromHash. - from
Iriβ usesnewinURI. - from
RDF::Trine::Node::Resource,RDF::Trine::Namespace,XML::Namespaceβ usesnewinURI.
π DataUri
a subtype of Uri that covers URI::data. π the menu:
- from
Strβ usesnewinURI::data. - from
ScalarRefβ usesnewinURI::data. - from
HashRefβ coerces using URI::FromHash. - from
Iriβ usesnewinURI. - from
RDF::Trine::Node::Resource,RDF::Trine::Namespace,XML::Namespaceβ usesnewinURI.
π§ Iri
a class type for IRI. coercions work exactly as per Uri up above π, plus it can also coerce from Uri. yeah, it does the whole circuit. π₯
π BUGS π
found a bug? not the vibe, but ok, spill it here bestie: <http://rt.cpan.org/Dist/Display.html?Queue=Types-URI>. π
π SEE ALSO π
go read these too, they're iconic:
MooseX::Types::URI, Type::Tiny::Manual, URI, URI::file, URI::data, URI::FromHash, RDF::Trine::Node::Resource, IRI.
Types::UUID, Types::Path::Tiny, Types::Standard.
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2014 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.
like, no promises, bestie. none. zero. that's the whole clause. π
and that's the page!! this was Types::URI(3pm), perl v5.36.0, dated 2022-11-29 β you didn't hear it from me but that date is lowkey a whole vibe. go write some type constraints, you absolute main character. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: libtypes-uri-perl 0.007-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtypes-uri-perl 0.007-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtypes-uri-perl 0.007-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms