pub enum PromptSelector {
Latest,
Label(String),
Version(PromptVersion),
}Expand description
Which version of a prompt is wanted.
The three arms are three different postures towards a moving registry, and they are worth choosing between deliberately:
Latesttakes whatever the source considers current. Fine for a compiled-in source, where “current” means “what is in this binary”.Labeltakes the version somebody has marked —productionbeing the usual one. Convenient, and it means an edit in the registry changes a running system without a deploy, which is the trade being made.Versionpins. A registry edit then cannot change what the system does; only a deploy can, and the pinned version is what the replay record cites. This is the arm a deployment that cares about reproducibility uses.
Deliberately not #[non_exhaustive], unlike most growable enums in this
crate. A PromptSource has to decide what every selector means for it,
and a wildcard arm decides by accident: it would serve something for a
selector the source has never heard of, which is the one behaviour a pin
exists to rule out. Adding an arm here should break every source and make
each of them say what it does.
Variants§
Latest
Whatever the source considers current.
Label(String)
The version carrying this deployment label.
Version(PromptVersion)
This exact version, and no other.
Implementations§
Source§impl PromptSelector
impl PromptSelector
Trait Implementations§
Source§impl Clone for PromptSelector
impl Clone for PromptSelector
Source§impl Debug for PromptSelector
impl Debug for PromptSelector
Source§impl Default for PromptSelector
impl Default for PromptSelector
Source§impl Display for PromptSelector
impl Display for PromptSelector
impl Eq for PromptSelector
Source§impl Hash for PromptSelector
impl Hash for PromptSelector
Source§impl Ord for PromptSelector
impl Ord for PromptSelector
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PromptSelector
impl PartialEq for PromptSelector
Source§impl PartialOrd for PromptSelector
impl PartialOrd for PromptSelector
impl StructuralPartialEq for PromptSelector
Auto Trait Implementations§
impl Freeze for PromptSelector
impl RefUnwindSafe for PromptSelector
impl Send for PromptSelector
impl Sync for PromptSelector
impl Unpin for PromptSelector
impl UnsafeUnpin for PromptSelector
impl UnwindSafe for PromptSelector
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.