Mango::BSON::Binary(3pm) | User Contributed Perl Documentation | Mango::BSON::Binary(3pm) |
Mango::BSON::Binary - Binary type
use Mango::BSON::Binary; my $bin = Mango::BSON::Binary->new(data => $bytes, type => 'generic'); say $bin->data;
Mango::BSON::Binary is a container for the BSON binary type used by Mango::BSON. For "JSON" implementations like Mojo::JSON, that support the "TO_JSON" method, it will automatically "Base64" encode the binary data.
Mango::BSON::Binary implements the following attributes.
my $bytes = $bin->data; $bin = $bin->data($bytes);
Binary data.
my $type = $bin->type; $bin = $bin->type('generic');
Binary subtype.
Mango::BSON::Binary inherits all methods from Mojo::Base and implements the following new ones.
my $b64 = $bin->TO_JSON;
Base64 encode "data".
Mango::BSON::Binary overloads the following operators.
my $bool = !!$bin;
Always true.
my $str = "$bin";
Alias for "data".
Mango, Mojolicious::Guides, <http://mojolicio.us>.
2020-06-05 | perl v5.30.3 |