NAME

Net::Blossom::Server::BlobResult - Result of a Blossom blob lookup

SYNOPSIS

use Net::Blossom::Server::BlobResult;

my $result = Net::Blossom::Server::BlobResult->new(
    descriptor => $blob,
    body       => $bytes,
);

DESCRIPTION

Net::Blossom::Server::BlobResult describes a blob available for download. It keeps the descriptor and response body together so server routing can return the blob bytes with headers derived from the descriptor.

CONSTRUCTOR

new

my $result = Net::Blossom::Server::BlobResult->new(%args);

Required arguments:

  • descriptor

    A Net::Blossom::BlobDescriptor for the blob.

  • body

    The blob body as a scalar, an array reference of scalar chunks, or a stream object that provides read or getline. Scalar and array bodies must have a total byte length equal to $descriptor->size. Stream bodies are not read or buffered by this object.

Unknown arguments or invalid values croak.

ACCESSORS

descriptor

Returns the Net::Blossom::BlobDescriptor.

body

Returns the scalar, array reference, or stream object body.