Struct ckb_jsonrpc_types::JsonBytes
source · [−]pub struct JsonBytes(_);
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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for JsonBytes
impl<'de> Deserialize<'de> for JsonBytes
sourcefn 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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more