Struct lightning_encoding::BigSize [−][src]
pub struct BigSize(_);
Expand description
Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin’s variable-length integers except that it is serialized in big-endian instead of little-endian.
BigSize specification is given at https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#type-length-value-format
Like Bitcoin’s variable-length integer, it exhibits ambiguity in that certain values can be encoded in several different ways, which we must check for at deserialization-time. Thus, if you’re looking for an example of a variable-length integer to use for your own project, move along, this is a rather poor design.
Trait Implementations
Performs the +=
operation. Read more
Mutably borrows from an owned value. Read more
Performs the /=
operation. Read more
Decode with the given std::io::Read
instance; must either
construct an instance or return implementation-specific error type. Read more
Tries to deserialize byte array into the current type using
LightningDecode::lightning_decode
function. Read more
Encode with the given std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type. Read more
Serializes data as a byte array using
LightningEncode::lightning_encode
function. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the -=
operation. Read more
Instantiates wrapper type with the inner data
Returns reference to the inner representation for the wrapper type
Returns a mutable reference to the inner representation for the wrapper type Read more
Unwraps the wrapper returning the inner type
Auto Trait Implementations
impl RefUnwindSafe for BigSize
impl UnwindSafe for BigSize
Blanket Implementations
Mutably borrows from an owned value. Read more