#[non_exhaustive]pub struct ResourceUrl {
pub res_type: ResourceType,
pub location: String,
pub transport_type: Option<TransportLayer>,
pub ref_: Option<String>,
pub rev: Option<String>,
pub ref_location: RefLocation,
}Expand description
A resource-style flake reference (git+https://..., hg+ssh://...,
file+https://..., tarball+https://...).
Like super::GitForge and super::FlakeRefType::Indirect, ref_ and
rev are typed slots fed from ?ref= / ?rev= query parameters at parse
time. ref_location records where a present value would be rendered on
Display so round-trips preserve the form. Resource only supports the
query-parameter form (not the path-component form GitForge/Indirect
have); RefLocation::PathComponent is the slot’s default and the parser
flips to QueryParameter whenever it routes a query-string value here.
#[non_exhaustive] reserves room for future fields without breaking
downstream match arms; in-crate construction with struct-literal syntax
stays allowed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.res_type: ResourceType§location: String§transport_type: Option<TransportLayer>§ref_: Option<String>§rev: Option<String>§ref_location: RefLocationImplementations§
Source§impl ResourceUrl
impl ResourceUrl
Sourcepub fn new(
res_type: ResourceType,
location: String,
transport_type: Option<TransportLayer>,
) -> Self
pub fn new( res_type: ResourceType, location: String, transport_type: Option<TransportLayer>, ) -> Self
Construct a ResourceUrl with no ref or rev set; the ref/rev slots
land via the parser’s query-string side-channel
(crate::parser::apply_param_ref_rev) once parsing completes.
Trait Implementations§
Source§impl Clone for ResourceUrl
impl Clone for ResourceUrl
Source§fn clone(&self) -> ResourceUrl
fn clone(&self) -> ResourceUrl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceUrl
impl Debug for ResourceUrl
Source§impl<'de> Deserialize<'de> for ResourceUrl
impl<'de> Deserialize<'de> for ResourceUrl
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>,
Source§impl PartialEq for ResourceUrl
impl PartialEq for ResourceUrl
Source§fn eq(&self, other: &ResourceUrl) -> bool
fn eq(&self, other: &ResourceUrl) -> bool
self and other values to be equal, and is used by ==.