#[non_exhaustive]pub enum RefLocation {
PathComponent,
QueryParameter,
}Expand description
Names where a ref or rev is rendered in a FlakeRef.
RefLocation is a routing tag, not a presence flag: a FlakeRef whose
kind has no ref and no rev still carries a RefLocation saying where one
would be written if it were set. The “no ref or rev” state is encoded by
ref_ == None && rev == None on the kind, so a RefLocation::None
variant would be redundant and is therefore unrepresentable.
Default is PathComponent because that is the canonical form for the
ref-bearing kinds (GitForge, Indirect); the parser flips this to
QueryParameter when the value arrived via ?ref= / ?rev=, preserving
the round-trip shape.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PathComponent
Rendered in the path component, e.g. github:owner/repo/<value>.
QueryParameter
Rendered as a query parameter, e.g. ?ref=<value> or ?rev=<value>.
Trait Implementations§
Source§impl Clone for RefLocation
impl Clone for RefLocation
Source§fn clone(&self) -> RefLocation
fn clone(&self) -> RefLocation
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 RefLocation
impl Debug for RefLocation
Source§impl Default for RefLocation
impl Default for RefLocation
Source§fn default() -> RefLocation
fn default() -> RefLocation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RefLocation
impl<'de> Deserialize<'de> for RefLocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RefLocation
impl PartialEq for RefLocation
Source§fn eq(&self, other: &RefLocation) -> bool
fn eq(&self, other: &RefLocation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RefLocation
impl Serialize for RefLocation
impl Copy for RefLocation
impl Eq for RefLocation
impl StructuralPartialEq for RefLocation
Auto Trait Implementations§
impl Freeze for RefLocation
impl RefUnwindSafe for RefLocation
impl Send for RefLocation
impl Sync for RefLocation
impl Unpin for RefLocation
impl UnsafeUnpin for RefLocation
impl UnwindSafe for RefLocation
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