#[non_exhaustive]pub struct GitForge {
pub platform: GitForgePlatform,
pub owner: String,
pub repo: String,
pub ref_: Option<String>,
pub rev: Option<String>,
pub location: RefLocation,
}Expand description
A reference into a git forge (github:, gitlab:, sourcehut:).
Ref and rev are stored as separate typed slots; the parser splits a
path-component value (github:owner/repo/<x>) into rev if <x> is
40-hex, otherwise into ref_. The
location field records where the value would be rendered on Display,
so round-trips preserve ?ref= vs /ref form. The “no ref and no rev”
state is encoded by both fields being None; location still defaults
to PathComponent for that case.
#[non_exhaustive] reserves room for future fields (e.g. host,
submodules) to land here without breaking match arms downstream.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.platform: GitForgePlatform§owner: String§repo: String§ref_: Option<String>§rev: Option<String>§location: RefLocationTrait Implementations§
Source§impl<'de> Deserialize<'de> for GitForge
impl<'de> Deserialize<'de> for GitForge
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
impl Eq for GitForge
impl StructuralPartialEq for GitForge
Auto Trait Implementations§
impl Freeze for GitForge
impl RefUnwindSafe for GitForge
impl Send for GitForge
impl Sync for GitForge
impl Unpin for GitForge
impl UnsafeUnpin for GitForge
impl UnwindSafe for GitForge
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