cbor: support tagged values

This commit is contained in:
David Drysdale
2021-06-10 09:28:56 +01:00
committed by kaczmarczyck
parent 3aca5fbc74
commit fbe68b55cd
4 changed files with 96 additions and 21 deletions

View File

@@ -336,6 +336,14 @@ macro_rules! cbor_bytes {
};
}
/// Creates a CBOR Value of type Tag with the given tag and object.
#[macro_export]
macro_rules! cbor_tagged {
( $t:expr, $x: expr ) => {
$crate::values::Value::Tag($t, ::alloc::boxed::Box::new($x))
};
}
/// Creates a CBOR Value of type Byte String with the given byte string literal.
///
/// Example usage: