pub struct BytesEnvelope {
pub content: String,
pub content_type: String,
}Expand description
A generic envelope for byte-encoded data with content type information.
This structure wraps binary data (typically encoded as hex or base64 strings) along with metadata about the content type and encoding. It’s commonly used for transaction bytes, signatures, and other cryptographic data.
§Fields
content- The encoded data as a string (typically hex or base64)content_type- MIME type or encoding identifier (e.g., “application/cbor”, “hex”)
§Example
ⓘ
use tx3_sdk::core::BytesEnvelope;
let envelope = BytesEnvelope {
content: "a10081825820abc123...".to_string(),
content_type: "application/cbor".to_string(),
};Fields§
§content: StringThe encoded payload content as a string.
This field accepts either the alias “payload” or the primary name “content” for backward compatibility with different serialization formats.
content_type: StringThe content type or encoding of the payload.
This field accepts either “contentType” or the alias “encoding” for backward compatibility with different serialization formats.
Trait Implementations§
Source§impl Clone for BytesEnvelope
impl Clone for BytesEnvelope
Source§fn clone(&self) -> BytesEnvelope
fn clone(&self) -> BytesEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BytesEnvelope
impl Debug for BytesEnvelope
Source§impl<'de> Deserialize<'de> for BytesEnvelope
impl<'de> Deserialize<'de> for BytesEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BytesEnvelope
impl RefUnwindSafe for BytesEnvelope
impl Send for BytesEnvelope
impl Sync for BytesEnvelope
impl Unpin for BytesEnvelope
impl UnsafeUnpin for BytesEnvelope
impl UnwindSafe for BytesEnvelope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more