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
Variants
Present(T)
Optional field is included in message
Absent
Optional field is absent in message
Trait Implementations
sourceimpl<T: Clone> Clone for OptionalField<T>
impl<T: Clone> Clone for OptionalField<T>
sourcefn clone(&self) -> OptionalField<T>
fn clone(&self) -> OptionalField<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for OptionalField<T>
impl<T: Debug> Debug for OptionalField<T>
sourceimpl<T: PartialEq> PartialEq<OptionalField<T>> for OptionalField<T>
impl<T: PartialEq> PartialEq<OptionalField<T>> for OptionalField<T>
sourcefn 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 ==
. Read more
sourceimpl Readable for OptionalField<Script>
impl Readable for OptionalField<Script>
sourceimpl Readable for OptionalField<u64>
impl Readable for OptionalField<u64>
sourceimpl Writeable for OptionalField<Script>
impl Writeable for OptionalField<Script>
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn serialized_length(&self) -> usize
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. Read more
sourceimpl Writeable for OptionalField<u64>
impl Writeable for OptionalField<u64>
sourcefn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Writes self out to a Vec
sourcefn serialized_length(&self) -> usize
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. Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more