rust

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CratesIOAPIURL = "https://crates.io/api/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type CrateInfo

type CrateInfo struct {
	Crate struct {
		Name            string   `json:"name"`
		MaxVersion      string   `json:"max_version"`
		Description     string   `json:"description"`
		Homepage        string   `json:"homepage"`
		Repository      string   `json:"repository"`
		Documentation   string   `json:"documentation"`
		Downloads       int64    `json:"downloads"`
		RecentDownloads int64    `json:"recent_downloads"`
		CreatedAt       string   `json:"created_at"`
		UpdatedAt       string   `json:"updated_at"`
		NumVersions     int      `json:"num_versions"`
		Keywords        []string `json:"keywords"`
		Categories      []string `json:"categories"`
	} `json:"crate"`
	Versions []Version `json:"versions"`
}

CrateInfo represents information about a Rust crate from crates.io

type RustTool

type RustTool struct {
	// contains filtered or unexported fields
}

RustTool handles Rust crate version checking

func NewRustTool

func NewRustTool(client packageversions.HTTPClient) *RustTool

NewRustTool creates a new rust tool with the given HTTP client

func (*RustTool) Definition

func (t *RustTool) Definition() mcp.Tool

Definition returns the tool's definition for MCP registration

func (*RustTool) Execute

func (t *RustTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, args map[string]any) (*mcp.CallToolResult, error)

Execute executes the tool's logic

type Version added in v0.29.1

type Version struct {
	Num         string `json:"num"`
	License     string `json:"license"`
	CreatedAt   string `json:"created_at"`
	Downloads   int64  `json:"downloads"`
	Yanked      bool   `json:"yanked"`
	RustVersion string `json:"rust_version"`
	Edition     string `json:"edition"`
	CrateSize   int64  `json:"crate_size"`
	PublishedBy struct {
		Login  string `json:"login"`
		Name   string `json:"name"`
		Avatar string `json:"avatar"`
		URL    string `json:"url"`
	} `json:"published_by"`
}

Version represents a crate version from crates.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL