pub trait LightningDecodewhere
Self: Sized,
{ // Required method fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>; // Provided method 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§

source

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§

source

fn lightning_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>

Tries to deserialize byte array into the current type using LightningDecode::lightning_decode function.

Implementations on Foreign Types§

source§

impl LightningDecode for Script

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<const LEN: usize> LightningDecode for [u8; LEN]

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for Box<[u8]>

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for String

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Option<T>where
T: LightningDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Vec<T>where
T: LightningDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for HashSet<T>where
T: LightningDecode + Eq + Hash,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<K, V> LightningDecode for HashMap<K, V>where
K: LightningDecode + Eq + Hash,
V: LightningDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for BTreeSet<T>where
T: LightningDecode + Ord,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<K, V> LightningDecode for BTreeMap<K, V>where
K: LightningDecode + Ord,
V: LightningDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

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

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for u8

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for u16

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for u24

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for u32

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for u64

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for usize

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for FlagVec

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl LightningDecode for Slice32

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Holder<T, AsStrict>where
T: StrictDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Holder<T, AsBitcoinHash>where
T: Hash + StrictDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Holder<T, AsWrapped>where
T: Wrapper,
T::Inner: LightningDecode,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

source§

impl<T> LightningDecode for Holder<T, AsBigSize>where
T: From<BigSize>,

source§

fn lightning_decode<D: Read>(d: D) -> Result<Self, Error>

Implementors§