role Distribution

Distribution
role Distribution { }

This role is an interface for objects that provide API access mapping META6 data to the files it 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.rakumod or resources/foo.txt.

See Also

role Callable

Invocable code object

role Dateish

Object that can be treated as a date

role Encoding

Support for character encodings.

role PredictiveIterator

Iterators that can predict number of values

class RakuAST::Doc::DeclaratorTarget

Provide leading/trailing doc functionality

role Rational

Number stored as numerator and denominator

role Real

Non-complex number

role Stringy

String or object that can act as a string

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.