Trait lightning::util::ser::Writeable

source ·
pub trait Writeable {
    // Required method
    fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>;

    // Provided methods
    fn encode(&self) -> Vec<u8>  { ... }
    fn serialized_length(&self) -> usize { ... }
}
Expand description

A trait that various LDK types implement allowing them to be written out to a Writer.

This is not exported to bindings users as we only export serialization to/from byte arrays instead

Required Methods§

source

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given Writer.

Provided Methods§

source

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.

source

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Writeable for Infallible

source§

fn write<W: Writer>(&self, _: &mut W) -> Result<(), Error>

source§

impl Writeable for Option<Vec<Option<(usize, Signature)>>>

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for bool

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for i8

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for i16

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for i32

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for i64

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for u8

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for u16

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for u32

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for u64

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for u128

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for ()

source§

fn write<W: Writer>(&self, _: &mut W) -> Result<(), Error>

source§

impl Writeable for VecDeque<(Event, Option<EventCompletionAction>)>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for String

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<&UpdateAddHTLC>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<&BlindedTail>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<SocketAddress>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<u8>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<ChannelMonitorUpdate>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<UpdateAddHTLC>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<Witness>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<Signature>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Vec<MonitorUpdateCompletionAction>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Duration

This is not exported to bindings users as Durations are simply mapped as ints.

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for ChainHash

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for ScriptBuf

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for OutPoint

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Transaction

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for TxOut

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for Witness

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl Writeable for BlockHash

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Txid

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Hash

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for Signature

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for PublicKey

source§

impl Writeable for SecretKey

source§

impl Writeable for Signature

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 3]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 4]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 12]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 16]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 32]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 33]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 64]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 66]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u8; 1300]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u16; 8]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl Writeable for [u16; 32]

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<'a, T: Writeable> Writeable for &'a T

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

source§

impl<A: Writeable, B: Writeable> Writeable for (A, B)

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<A: Writeable, B: Writeable> Writeable for Vec<(A, B)>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<A: Writeable, B: Writeable, C: Writeable> Writeable for (A, B, C)

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<A: Writeable, B: Writeable, C: Writeable, D: Writeable> Writeable for (A, B, C, D)

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

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

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

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

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<T: OnionMessageContents> Writeable for (Payload<T>, [u8; 32])

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<T: Writeable> Writeable for Option<T>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<T: Writeable> Writeable for Box<T>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<T: Writeable> Writeable for Mutex<T>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

source§

impl<T: Writeable> Writeable for RwLock<T>

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

Implementors§

source§

impl Writeable for PaymentContext

source§

impl Writeable for MonitorEvent

source§

impl Writeable for ClosureReason

source§

impl Writeable for Event

source§

impl Writeable for HTLCDestination

source§

impl Writeable for PathFailure

source§

impl Writeable for PaymentFailureReason

source§

impl Writeable for PaymentPurpose

source§

impl Writeable for BlindedFailure

source§

impl Writeable for ChannelShutdownState

source§

impl Writeable for InboundHTLCStateDetails

Available on non-fuzzing only.
source§

impl Writeable for OutboundHTLCStateDetails

Available on non-fuzzing only.
source§

impl Writeable for PendingHTLCRouting

source§

impl Writeable for Retry

source§

impl Writeable for SocketAddress

source§

impl Writeable for OffersMessage

source§

impl Writeable for NetworkUpdate

source§

impl Writeable for SpendableOutputDescriptor

source§

impl Writeable for MaxDustHTLCExposure

source§

impl Writeable for APIError

source§

impl Writeable for OutputSpendStatus

source§

impl Writeable for Bolt12OfferContext

source§

impl Writeable for Bolt12RefundContext

source§

impl Writeable for ForwardTlvs

source§

impl Writeable for PaymentConstraints

source§

impl Writeable for PaymentRelay

source§

impl Writeable for ReceiveTlvs

source§

impl Writeable for UnknownPaymentContext

source§

impl Writeable for BlindedHop

source§

impl Writeable for BlindedPath

source§

impl Writeable for ChannelMonitorUpdate

source§

impl Writeable for HTLCUpdate

source§

impl Writeable for BestBlock

source§

impl Writeable for ClaimId

source§

impl Writeable for lightning::chain::transaction::OutPoint

source§

impl Writeable for ClaimedHTLC

source§

impl Writeable for BuiltCommitmentTransaction

source§

impl Writeable for ChannelPublicKeys

source§

impl Writeable for ChannelTransactionParameters

source§

impl Writeable for CommitmentTransaction

source§

impl Writeable for CounterpartyChannelTransactionParameters

source§

impl Writeable for CounterpartyCommitmentSecrets

source§

impl Writeable for HTLCOutputInCommitment

source§

impl Writeable for HolderCommitmentTransaction

source§

impl Writeable for TxCreationKeys

source§

impl Writeable for DelayedPaymentBasepoint

source§

impl Writeable for DelayedPaymentKey

source§

impl Writeable for HtlcBasepoint

source§

impl Writeable for HtlcKey

source§

impl Writeable for RevocationBasepoint

source§

impl Writeable for RevocationKey

source§

impl Writeable for BlindedForward

source§

impl Writeable for ChannelCounterparty

source§

impl Writeable for ChannelDetails

source§

impl Writeable for CounterpartyForwardingInfo

source§

impl Writeable for InboundHTLCDetails

Available on non-fuzzing only.
source§

impl Writeable for InterceptId

source§

impl Writeable for OutboundHTLCDetails

Available on non-fuzzing only.
source§

impl Writeable for PaymentId

source§

impl Writeable for PendingHTLCInfo

source§

impl Writeable for PhantomRouteHints

source§

impl Writeable for RecipientOnionFields

source§

impl Writeable for AcceptChannel

source§

impl Writeable for AcceptChannelV2

source§

impl Writeable for AnnouncementSignatures

source§

impl Writeable for ChannelAnnouncement

source§

impl Writeable for ChannelReady

source§

impl Writeable for ChannelReestablish

source§

impl Writeable for ChannelUpdate

source§

impl Writeable for ClosingSigned

source§

impl Writeable for ClosingSignedFeeRange

source§

impl Writeable for CommitmentSigned

source§

impl Writeable for ErrorMessage

source§

impl Writeable for FinalOnionHopData

source§

impl Writeable for FundingCreated

source§

impl Writeable for FundingSigned

source§

impl Writeable for GossipTimestampFilter

source§

impl Writeable for Init

source§

impl Writeable for NodeAnnouncement

source§

impl Writeable for OnionMessage

source§

impl Writeable for OnionPacket

source§

impl Writeable for OpenChannel

source§

impl Writeable for OpenChannelV2

source§

impl Writeable for Ping

source§

impl Writeable for Pong

source§

impl Writeable for QueryChannelRange

source§

impl Writeable for QueryShortChannelIds

source§

impl Writeable for ReplyChannelRange

source§

impl Writeable for ReplyShortChannelIdsEnd

source§

impl Writeable for RevokeAndACK

source§

impl Writeable for Shutdown

source§

impl Writeable for Splice

source§

impl Writeable for SpliceAck

source§

impl Writeable for SpliceLocked

source§

impl Writeable for Stfu

source§

impl Writeable for TrampolineOnionPacket

source§

impl Writeable for TxAbort

source§

impl Writeable for TxAckRbf

source§

impl Writeable for TxAddInput

source§

impl Writeable for TxAddOutput

source§

impl Writeable for TxComplete

source§

impl Writeable for TxInitRbf

source§

impl Writeable for TxRemoveInput

source§

impl Writeable for TxRemoveOutput

source§

impl Writeable for TxSignatures

source§

impl Writeable for UnsignedChannelAnnouncement

source§

impl Writeable for UnsignedChannelUpdate

source§

impl Writeable for UnsignedNodeAnnouncement

source§

impl Writeable for UpdateAddHTLC

source§

impl Writeable for UpdateFailHTLC

source§

impl Writeable for UpdateFailMalformedHTLC

source§

impl Writeable for UpdateFee

source§

impl Writeable for UpdateFulfillHTLC

source§

impl Writeable for WarningMessage

source§

impl Writeable for ShutdownScript

source§

impl Writeable for ChannelId

source§

impl Writeable for PaymentHash

source§

impl Writeable for PaymentPreimage

source§

impl Writeable for PaymentSecret

source§

impl Writeable for BlindedPayInfo

source§

impl Writeable for Bolt12Invoice

source§

impl Writeable for UnsignedBolt12Invoice

source§

impl Writeable for InvoiceError

source§

impl Writeable for InvoiceRequest

source§

impl Writeable for InvoiceRequestFields

source§

impl Writeable for UnsignedInvoiceRequest

source§

impl Writeable for Offer

source§

impl Writeable for OfferId

source§

impl Writeable for Refund

source§

impl Writeable for Packet

source§

impl Writeable for ChannelInfo

source§

impl Writeable for ChannelUpdateInfo

source§

impl Writeable for NodeAlias

source§

impl Writeable for NodeAnnouncementInfo

source§

impl Writeable for NodeId

source§

impl Writeable for NodeInfo

source§

impl Writeable for RoutingFees

source§

impl Writeable for BlindedTail

source§

impl Writeable for InFlightHtlcs

source§

impl Writeable for PaymentParameters

source§

impl Writeable for Route

source§

impl Writeable for RouteHint

source§

impl Writeable for RouteHintHop

source§

impl Writeable for RouteHop

source§

impl Writeable for RouteParameters

source§

impl Writeable for FixedPenaltyScorer

source§

impl Writeable for ChannelDerivationParameters

source§

impl Writeable for DelayedPaymentOutputDescriptor

source§

impl Writeable for HTLCDescriptor

source§

impl Writeable for InMemorySigner

source§

impl Writeable for StaticPaymentOutputDescriptor

source§

impl Writeable for ChannelConfig

source§

impl Writeable for UntrustedString

source§

impl Writeable for TrackedSpendableOutput

source§

impl Writeable for BigSize

source§

impl Writeable for Hostname

source§

impl Writeable for TransactionU16LenLimited

source§

impl Writeable for WithoutLength<&UntrustedString>

source§

impl Writeable for WithoutLength<&String>

source§

impl Writeable for WithoutLength<&ScriptBuf>

source§

impl Writeable for BlindedHopFeatures

source§

impl Writeable for Bolt11InvoiceFeatures

source§

impl Writeable for Bolt12InvoiceFeatures

source§

impl Writeable for ChannelFeatures

source§

impl Writeable for ChannelTypeFeatures

source§

impl Writeable for InitFeatures

source§

impl Writeable for NodeFeatures

source§

impl<'a> Writeable for UnsignedGossipMessage<'a>

source§

impl<'a, T: Writeable> Writeable for WithoutLength<&'a Vec<T>>

source§

impl<G: Deref<Target = NetworkGraph<L>>, L: Deref> Writeable for ProbabilisticScorer<G, L>
where L::Target: Logger,

source§

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

source§

impl<L: Deref> Writeable for NetworkGraph<L>
where L::Target: Logger,

source§

impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref> Writeable for ChannelManager<M, T, ES, NS, SP, F, R, L>

source§

impl<Signer: WriteableEcdsaChannelSigner> Writeable for ChannelMonitor<Signer>

source§

impl<T: OnionMessageContents> Writeable for ParsedOnionMessageContents<T>

source§

impl<T: Context> Writeable for WithoutLength<&Features<T>>