pub enum Choice3<L, C, R> {
One(L),
Two(C),
Three(R),
}
Expand description
A value encoder for a three-variant enum.
Instead of implementing Values
for an enum manually, you can just
define a method encode
that returns a value of this type.
Variants
One(L)
The first choice.
Two(C)
The second choice.
Three(R)
The third choice.
Trait Implementations
sourceimpl<L: Values, C: Values, R: Values> Values for Choice3<L, C, R>
impl<L: Values, C: Values, R: Values> Values for Choice3<L, C, R>
sourcefn encoded_len(&self, mode: Mode) -> usize
fn encoded_len(&self, mode: Mode) -> usize
Returns the length of the encoded values for the given mode.
sourcefn write_encoded<W: Write>(&self, mode: Mode, target: &mut W) -> Result<(), Error>
fn write_encoded<W: Write>(&self, mode: Mode, target: &mut W) -> Result<(), Error>
Encodes the values in the given mode and writes them to target
.
sourcefn explicit(self, tag: Tag) -> Constructed<Self> where
Self: Sized,
fn explicit(self, tag: Tag) -> Constructed<Self> where
Self: Sized,
Converts the encoder into one with an explicit tag.
sourcefn to_captured(&self, mode: Mode) -> Captured
fn to_captured(&self, mode: Mode) -> Captured
Captures the encoded values in the given mode.
Auto Trait Implementations
impl<L, C, R> RefUnwindSafe for Choice3<L, C, R> where
C: RefUnwindSafe,
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, C, R> Send for Choice3<L, C, R> where
C: Send,
L: Send,
R: Send,
impl<L, C, R> Sync for Choice3<L, C, R> where
C: Sync,
L: Sync,
R: Sync,
impl<L, C, R> Unpin for Choice3<L, C, R> where
C: Unpin,
L: Unpin,
R: Unpin,
impl<L, C, R> UnwindSafe for Choice3<L, C, R> where
C: UnwindSafe,
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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