pub struct GoMod {
pub module_path: String,
pub go_version: String,
pub toolchain: Option<String>,
pub requires: Vec<(String, String)>,
pub replaces: Vec<ReplaceDirective>,
}Expand description
The parsed shape of a go.mod, before target resolution.
Fields§
§module_path: String§go_version: String§toolchain: Option<String>§requires: Vec<(String, String)>(path, version) per require edge.
replaces: Vec<ReplaceDirective>Implementations§
Source§impl GoMod
impl GoMod
Sourcepub fn parse(text: &str) -> Self
pub fn parse(text: &str) -> Self
Parse go.mod text. Tolerant of comments, blank lines, and both
single-line + parenthesized-block forms for require/replace.
Sourcepub fn to_module_spec(
&self,
dep_mode: DepMode,
vendor_hash: Option<String>,
) -> ModuleSpec
pub fn to_module_spec( &self, dep_mode: DepMode, vendor_hash: Option<String>, ) -> ModuleSpec
Lower the parsed go.mod into the spec’s ModuleSpec. dep_mode
is the caller’s decision (M1 ⇒ Vendored); vendor_hash is the
coarse-path fallback (always None on the incremental path).
Trait Implementations§
impl Eq for GoMod
impl StructuralPartialEq for GoMod
Auto Trait Implementations§
impl Freeze for GoMod
impl RefUnwindSafe for GoMod
impl Send for GoMod
impl Sync for GoMod
impl Unpin for GoMod
impl UnsafeUnpin for GoMod
impl UnwindSafe for GoMod
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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.