Skip to main content

GoListPackage

Struct GoListPackage 

Source
pub struct GoListPackage {
Show 14 fields pub dir: String, pub import_path: String, pub name: String, pub root: String, pub standard: bool, pub dep_only: bool, pub go_files: Vec<String>, pub cgo_files: Vec<String>, pub s_files: Vec<String>, pub embed_patterns: Vec<String>, pub embed_files: Vec<String>, pub imports: Vec<String>, pub import_map: BTreeMap<String, String>, pub module: Option<GoListModule>,
}
Expand description

One go list -json package object. Field names are Go’s PascalCase; every list/map/bool field defaults so an omitted-when-empty field (go list’s convention) deserializes cleanly.

Fields§

§dir: String

Absolute on-disk directory of the package.

§import_path: String

Canonical import path — the node id.

§name: String

Package clause name; "main" ⇒ a linkable binary.

§root: String

Module root directory this package lives under. For own packages AND vendored deps this is the main module’s root (vendor/ is under it); for std it is $GOROOT/src.

§standard: bool

True ⇒ standard-library package (provided by the shared std derivation, never per-node source).

§dep_only: bool

True ⇒ this package is only in the graph as a dependency (never a queried root) — so it is never a workspace_member.

§go_files: Vec<String>

Tag-resolved non-test Go sources for this tuple (Go-I6).

§cgo_files: Vec<String>

cgo sources. Non-empty on a module/main node ⇒ M1 rejects the build (Go-I12); M-cgo lifts this to kind = Cgo.

§s_files: Vec<String>

Assembly sources. Non-empty on a non-std node ⇒ M1 rejects (Go-I12); std asm lives inside the opaque std-tree.

§embed_patterns: Vec<String>

//go:embed patterns (drives -embedcfg).

§embed_files: Vec<String>

Resolved embed files (relative to Dir).

§imports: Vec<String>

Direct imports (the per-node DAG edges). Deps (transitive) is intentionally NOT modeled — the closure is seeded by the full stream, and per-node importcfg needs only direct edges.

§import_map: BTreeMap<String, String>

Vendor/replace rewrite: source import path → actual package path.

§module: Option<GoListModule>

Owning module (own module vs a vendored dep). Absent for std.

Implementations§

Source§

impl GoListPackage

Source

pub fn kind(&self) -> PackageKind

Classify into the M1 PackageKind. cgo/asm nodes are NOT classified here — the encoder rejects them up front (Go-I12).

Trait Implementations§

Source§

impl Clone for GoListPackage

Source§

fn clone(&self) -> GoListPackage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GoListPackage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GoListPackage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.