role Distribution


role Distribution { }

Interface for objects that provide API access mapping META6 data to the files its represents. Objects that fulfill the Distribution role can be read by e.g. CompUnit::Repository::Installation. Generally a Distribution provides read access to a set of modules and metadata. These may be backed by the filesystem (Distribution::Path, Distribution::Hash) but could also read from an e.g. tar file or socket.

Required Methods

method meta

method meta(--> Hash:D{ ... }

Returns a Hash with the representation of the metadata. Please note that an actual META6.json file does not need to exist, just a representation in that format.

method content

method content($name-path --> IO::Handle:D{ ... }

Returns an IO::Handle to the file represented by $name-path. $name-path is a relative path as it would be found in the metadata such as lib/Foo.pm6 or resources/foo.txt.

Type Graph

Type relations for Distribution
perl6-type-graph Distribution Distribution Distribution::Locally Distribution::Locally Distribution::Locally->Distribution Mu Mu Any Any Any->Mu Distribution::Hash Distribution::Hash Distribution::Hash->Distribution::Locally Distribution::Hash->Any Distribution::Path Distribution::Path Distribution::Path->Distribution::Locally Distribution::Path->Any

Expand above chart