Struct ckb_jsonrpc_types::JsonBytes
source · pub struct JsonBytes(/* private fields */);
Expand description
Variable-length binary encoded as a 0x-prefixed hex string in JSON.
Example
JSON | Binary |
---|---|
“0x” | Empty binary |
“0x00” | Single byte 0 |
“0x636b62” | 3 bytes, UTF-8 encoding of ckb |
“00” | Invalid, 0x is required |
“0x0” | Invalid, each byte requires 2 digits |
Implementations§
source§impl JsonBytes
impl JsonBytes
sourcepub fn from_bytes(bytes: Bytes) -> Self
pub fn from_bytes(bytes: Bytes) -> Self
Creates the JsonBytes
from Bytes
.
sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Converts into Bytes
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for JsonBytes
impl<'de> Deserialize<'de> for JsonBytes
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
source§impl PartialEq for JsonBytes
impl PartialEq for JsonBytes
impl Eq for JsonBytes
impl StructuralEq for JsonBytes
impl StructuralPartialEq for JsonBytes
Auto Trait Implementations§
impl RefUnwindSafe for JsonBytes
impl Send for JsonBytes
impl Sync for JsonBytes
impl Unpin for JsonBytes
impl UnwindSafe for JsonBytes
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