pub struct EnumChoice(/* private fields */);Expand description
An enum choice value.
An enum choice is identified by its enum type and choice name.
This type is cheaply cloneable.
Implementations§
Trait Implementations§
Source§impl Clone for EnumChoice
impl Clone for EnumChoice
Source§fn clone(&self) -> EnumChoice
fn clone(&self) -> EnumChoice
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnumChoice
impl Debug for EnumChoice
Source§impl Display for EnumChoice
Displays the choice name when an enum is used in string interpolation.
impl Display for EnumChoice
Displays the choice name when an enum is used in string interpolation.
§Design Decision
When an enum choice is interpolated in a WDL string (e.g., "~{Color.Red}"
where Red = "#FF0000"), this implementation displays the choice name
("Red") rather than the underlying value ("#FF0000").
This design choice treats enum choices as named identifiers, providing
stable, human-readable output that doesn’t depend on the underlying value
representation. To access the underlying value explicitly, use the value()
standard library function.
§Example
enum Color {
Red = "#FF0000",
Green = "#00FF00"
}
String name = "~{Color.Red}" # Produces "Red"
String hex_value = value(Color.Red) # Produces "#FF0000"Source§impl PartialEq for EnumChoice
impl PartialEq for EnumChoice
Auto Trait Implementations§
impl Freeze for EnumChoice
impl RefUnwindSafe for EnumChoice
impl Send for EnumChoice
impl Sync for EnumChoice
impl Unpin for EnumChoice
impl UnsafeUnpin for EnumChoice
impl UnwindSafe for EnumChoice
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more