Enum lightning::ln::msgs::OptionalField
source · pub enum OptionalField<T> {
Present(T),
Absent,
}
Expand description
Messages could have optional fields to use with extended features
As we wish to serialize these differently from Option<T>
s (Options
get a tag byte, but
OptionalField
simply gets Present
if there are enough bytes to read into it), we have a
separate enum type for them.
This is not exported to bindings users due to a free generic in T
Variants§
Trait Implementations§
source§impl<T: Clone> Clone for OptionalField<T>
impl<T: Clone> Clone for OptionalField<T>
source§fn clone(&self) -> OptionalField<T>
fn clone(&self) -> OptionalField<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for OptionalField<T>
impl<T: Debug> Debug for OptionalField<T>
source§impl<T: PartialEq> PartialEq<OptionalField<T>> for OptionalField<T>
impl<T: PartialEq> PartialEq<OptionalField<T>> for OptionalField<T>
source§fn eq(&self, other: &OptionalField<T>) -> bool
fn eq(&self, other: &OptionalField<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Readable for OptionalField<Script>
impl Readable for OptionalField<Script>
source§impl Readable for OptionalField<u64>
impl Readable for OptionalField<u64>
source§impl Writeable for OptionalField<Script>
impl Writeable for OptionalField<Script>
source§impl Writeable for OptionalField<u64>
impl Writeable for OptionalField<u64>
impl<T: Eq> Eq for OptionalField<T>
impl<T> StructuralEq for OptionalField<T>
impl<T> StructuralPartialEq for OptionalField<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for OptionalField<T>where T: RefUnwindSafe,
impl<T> Send for OptionalField<T>where T: Send,
impl<T> Sync for OptionalField<T>where T: Sync,
impl<T> Unpin for OptionalField<T>where T: Unpin,
impl<T> UnwindSafe for OptionalField<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more