… | |
… | |
729 | |
729 | |
730 | =item CBOR::XS::as_bytes $value |
730 | =item CBOR::XS::as_bytes $value |
731 | |
731 | |
732 | Forces the value to be encoded as a (binary) string value. |
732 | Forces the value to be encoded as a (binary) string value. |
733 | |
733 | |
|
|
734 | =item CBOR::XS::as_bool $value |
|
|
735 | |
|
|
736 | Converts a Perl boolean (which can be any kind of scalar) into a CBOR |
|
|
737 | boolean. Exactly the same, but shorter to write, than: |
|
|
738 | |
|
|
739 | $value ? Types::Serialiser::true : Types::Serialiser::false |
|
|
740 | |
734 | =item CBOR::XS::as_float16 $value |
741 | =item CBOR::XS::as_float16 $value |
735 | |
742 | |
736 | Forces half-float (IEEE 754 binary16) encoding of the given value. |
743 | Forces half-float (IEEE 754 binary16) encoding of the given value. |
737 | |
744 | |
738 | =item CBOR::XS::as_float32 $value |
745 | =item CBOR::XS::as_float32 $value |
… | |
… | |
765 | sub CBOR::XS::as_bytes ($) { bless [$_[0], 2, undef], CBOR::XS::Tagged:: } |
772 | sub CBOR::XS::as_bytes ($) { bless [$_[0], 2, undef], CBOR::XS::Tagged:: } |
766 | sub CBOR::XS::as_text ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: } |
773 | sub CBOR::XS::as_text ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: } |
767 | sub CBOR::XS::as_float16 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: } |
774 | sub CBOR::XS::as_float16 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: } |
768 | sub CBOR::XS::as_float32 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: } |
775 | sub CBOR::XS::as_float32 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: } |
769 | sub CBOR::XS::as_float64 ($) { bless [$_[0], 6, undef], CBOR::XS::Tagged:: } |
776 | sub CBOR::XS::as_float64 ($) { bless [$_[0], 6, undef], CBOR::XS::Tagged:: } |
|
|
777 | |
|
|
778 | sub CBOR::XS::as_bool ($) { $_[0] ? Types::Serialiser::true : Types::Serialiser::false } |
770 | |
779 | |
771 | =head2 OBJECT SERIALISATION |
780 | =head2 OBJECT SERIALISATION |
772 | |
781 | |
773 | This module implements both a CBOR-specific and the generic |
782 | This module implements both a CBOR-specific and the generic |
774 | L<Types::Serialier> object serialisation protocol. The following |
783 | L<Types::Serialier> object serialisation protocol. The following |