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.

Implementations on Foreign Types§

source§

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

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 PublicKey

source§

impl Writeable for [u8; 3]

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 Vec<&BlindedTail>

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 [u8; 4]

source§

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

source§

impl Writeable for ()

source§

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

source§

impl Writeable for [u8; 33]

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 Writeable for TxOut

source§

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

source§

impl Writeable for ChainHash

source§

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

source§

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

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 SecretKey

source§

impl Writeable for [u8; 66]

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 Writeable for Script

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 HashMap<K, V>where K: Writeable + Eq + Hash, V: Writeable,

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<'a, T: Writeable> Writeable for &'a T

source§

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

source§

impl Writeable for Signature

source§

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

source§

impl Writeable for bool

source§

fn write<W: Writer>(&self, writer: &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 Writeable for u64

source§

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

source§

impl Writeable for Sha256dHash

source§

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

source§

impl Writeable for u16

source§

fn write<W: Writer>(&self, writer: &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 u128

source§

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

source§

impl Writeable for [u8; 32]

source§

fn write<W: Writer>(&self, w: &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 Writeable for Duration

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<A: Writeable, B: Writeable, C: Writeable> Writeable for (A, B, C)

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 Vec<MonitorUpdateCompletionAction>

source§

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

source§

impl Writeable for u32

source§

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

source§

impl Writeable for Txid

source§

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

source§

impl Writeable for u8

source§

fn write<W: Writer>(&self, writer: &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 Writeable for Signature

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 [u8; 64]

source§

fn write<W: Writer>(&self, w: &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 BlockHash

source§

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

source§

impl Writeable for Infallible

source§

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

source§

impl Writeable for String

source§

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

Implementors§

source§

impl Writeable for MonitorEvent

source§

impl Writeable for SpendableOutputDescriptor

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 NetAddress

source§

impl Writeable for OptionalField<u64>

source§

impl Writeable for OptionalField<Script>

source§

impl Writeable for NetworkUpdate

source§

impl Writeable for APIError

source§

impl Writeable for BlindedHop

source§

impl Writeable for BlindedPath

source§

impl Writeable for ChannelMonitorUpdate

source§

impl Writeable for HTLCUpdate

source§

impl Writeable for DelayedPaymentOutputDescriptor

source§

impl Writeable for InMemorySigner

source§

impl Writeable for StaticPaymentOutputDescriptor

source§

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

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 ChannelCounterparty

source§

impl Writeable for ChannelDetails

source§

impl Writeable for CounterpartyForwardingInfo

source§

impl Writeable for InterceptId

source§

impl Writeable for PaymentId

source§

impl Writeable for PhantomRouteHints

source§

impl Writeable for RecipientOnionFields

source§

impl Writeable for AcceptChannel

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 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 OpenChannel

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 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 PaymentHash

source§

impl Writeable for PaymentPreimage

source§

impl Writeable for PaymentSecret

source§

impl Writeable for BlindedPayInfo

source§

impl Writeable for Invoice

source§

impl Writeable for InvoiceRequest

source§

impl Writeable for Offer

source§

impl Writeable for Refund

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 ChannelConfig

source§

impl Writeable for UntrustedString

source§

impl Writeable for BigSize

source§

impl Writeable for Hostname

source§

impl Writeable for WithoutLength<&String>

source§

impl Writeable for BlindedHopFeatures

source§

impl Writeable for ChannelFeatures

source§

impl Writeable for ChannelTypeFeatures

source§

impl Writeable for InitFeatures

source§

impl Writeable for InvoiceFeatures

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, T: Time> Writeable for ProbabilisticScorerUsingTime<G, L, T>where L::Target: Logger,

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>where M::Target: Watch<<SP::Target as SignerProvider>::Signer>, T::Target: BroadcasterInterface, ES::Target: EntropySource, NS::Target: NodeSigner, SP::Target: SignerProvider, F::Target: FeeEstimator, R::Target: Router, L::Target: Logger,

source§

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

source§

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

This is not exported to bindings users as methods on non-cloneable enums are not currently exportable

source§

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