LengthReadable

Trait LengthReadable 

Source
pub trait LengthReadable
where Self: Sized,
{ // Required method fn read_from_fixed_length_buffer<R: LengthLimitedRead>( reader: &mut R, ) -> Result<Self, DecodeError>; }
Expand description

A trait that allows the implementer to be read in from a LengthLimitedRead, requiring the reader to limit the number of total bytes read from its underlying Read. Useful for structs that will always consume the entire provided Read when deserializing.

Any type that implements Readable also automatically has a LengthReadable implementation, but some types, most notably onion packets, only implement LengthReadable.

This is not exported to bindings users as reads are always from byte arrays, never streams, in bindings.

Required Methods§

Source

fn read_from_fixed_length_buffer<R: LengthLimitedRead>( reader: &mut R, ) -> Result<Self, DecodeError>

Reads a Self in from the given LengthLimitedRead.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl LengthReadable for AcceptChannel

Source§

impl LengthReadable for AcceptChannelV2

Source§

impl LengthReadable for AnnouncementSignatures

Source§

impl LengthReadable for ChannelAnnouncement

Source§

impl LengthReadable for ChannelReady

Source§

impl LengthReadable for ChannelReestablish

Source§

impl LengthReadable for ChannelUpdate

Source§

impl LengthReadable for ClosingComplete

Source§

impl LengthReadable for ClosingSig

Source§

impl LengthReadable for ClosingSigned

Source§

impl LengthReadable for CommitmentSigned

Source§

impl LengthReadable for ErrorMessage

Source§

impl LengthReadable for FundingCreated

Source§

impl LengthReadable for FundingSigned

Source§

impl LengthReadable for GossipTimestampFilter

Source§

impl LengthReadable for Init

Source§

impl LengthReadable for NodeAnnouncement

Source§

impl LengthReadable for OnionMessage

Source§

impl LengthReadable for OpenChannel

Source§

impl LengthReadable for OpenChannelV2

Source§

impl LengthReadable for PeerStorage

Source§

impl LengthReadable for PeerStorageRetrieval

Source§

impl LengthReadable for Ping

Source§

impl LengthReadable for Pong

Source§

impl LengthReadable for QueryChannelRange

Source§

impl LengthReadable for QueryShortChannelIds

Source§

impl LengthReadable for ReplyChannelRange

Source§

impl LengthReadable for ReplyShortChannelIdsEnd

Source§

impl LengthReadable for RevokeAndACK

Source§

impl LengthReadable for Shutdown

Source§

impl LengthReadable for SpliceAck

Source§

impl LengthReadable for SpliceInit

Source§

impl LengthReadable for SpliceLocked

Source§

impl LengthReadable for StartBatch

Source§

impl LengthReadable for Stfu

Source§

impl LengthReadable for TrampolineOnionPacket

Source§

impl LengthReadable for TxAbort

Source§

impl LengthReadable for TxAckRbf

Source§

impl LengthReadable for TxAddInput

Source§

impl LengthReadable for TxAddOutput

Source§

impl LengthReadable for TxComplete

Source§

impl LengthReadable for TxInitRbf

Source§

impl LengthReadable for TxRemoveInput

Source§

impl LengthReadable for TxRemoveOutput

Source§

impl LengthReadable for TxSignatures

Source§

impl LengthReadable for UnsignedChannelAnnouncement

Source§

impl LengthReadable for UnsignedChannelUpdate

Source§

impl LengthReadable for UnsignedNodeAnnouncement

Source§

impl LengthReadable for UpdateAddHTLC

Source§

impl LengthReadable for UpdateFailHTLC

Source§

impl LengthReadable for UpdateFailMalformedHTLC

Source§

impl LengthReadable for UpdateFee

Source§

impl LengthReadable for UpdateFulfillHTLC

Source§

impl LengthReadable for WarningMessage

Source§

impl LengthReadable for Bolt12Invoice

Source§

impl LengthReadable for InvoiceRequest

Source§

impl LengthReadable for Offer

Source§

impl LengthReadable for Refund

Source§

impl LengthReadable for StaticInvoice

Source§

impl LengthReadable for Packet

Source§

impl LengthReadable for WithoutLength<String>

Source§

impl LengthReadable for WithoutLength<ScriptBuf>

Source§

impl LengthReadable for WithoutLength<UntrustedString>

Source§

impl<T: LengthReadable> LengthReadable for RequiredWrapper<T>

Source§

impl<T: MaybeReadable> LengthReadable for WithoutLength<Vec<T>>

Source§

impl<T: Readable> LengthReadable for T