Trait lightning_encoding::LightningDecode [−][src]
pub trait LightningDecode where
Self: Sized, {
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>;
fn lightning_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error> { ... }
}
Expand description
Lightning-network specific encoding as defined in BOLT-1, 2, 3…
Required methods
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
Decode with the given std::io::Read
instance; must either
construct an instance or return implementation-specific error type.
Provided methods
Tries to deserialize byte array into the current type using
LightningDecode::lightning_decode
function.
Implementations on Foreign Types
impl<K, V> LightningDecode for HashMap<K, V> where
K: LightningDecode + Eq + Hash,
V: LightningDecode,
impl<K, V> LightningDecode for HashMap<K, V> where
K: LightningDecode + Eq + Hash,
V: LightningDecode,
impl<K, V> LightningDecode for BTreeMap<K, V> where
K: LightningDecode + Ord,
V: LightningDecode,
impl<K, V> LightningDecode for BTreeMap<K, V> where
K: LightningDecode + Ord,
V: LightningDecode,
impl<K, V> LightningDecode for (K, V) where
K: LightningDecode + Clone,
V: LightningDecode + Clone,
impl<K, V> LightningDecode for (K, V) where
K: LightningDecode + Clone,
V: LightningDecode + Clone,
Two-component tuples are decoded as they were fields in the parent data structure