Trait lightning_encoding::LightningDecode
source · [−]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
sourceimpl LightningDecode for Script
impl LightningDecode for Script
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<const LEN: usize> LightningDecode for [u8; LEN]
impl<const LEN: usize> LightningDecode for [u8; LEN]
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl LightningDecode for Box<[u8]>
impl LightningDecode for Box<[u8]>
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl LightningDecode for String
impl LightningDecode for String
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<T> LightningDecode for Option<T> where
T: LightningDecode,
impl<T> LightningDecode for Option<T> where
T: LightningDecode,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<T> LightningDecode for Vec<T> where
T: LightningDecode,
impl<T> LightningDecode for Vec<T> where
T: LightningDecode,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<T> LightningDecode for HashSet<T> where
T: LightningDecode + Eq + Hash,
impl<T> LightningDecode for HashSet<T> where
T: LightningDecode + Eq + Hash,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<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,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<T> LightningDecode for BTreeSet<T> where
T: LightningDecode + Ord,
impl<T> LightningDecode for BTreeSet<T> where
T: LightningDecode + Ord,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<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,
fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>
sourceimpl<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