Struct furse::Furse

source · []
pub struct Furse { /* private fields */ }
Expand description

An instance of the API to invoke API calls on

To initialise this container,

let curseforge = Furse::new(env!("CURSEFORGE_API_KEY"));
// Use the instance to call the API
let terralith_mod = curseforge.get_mod(513688).await?;

Implementations

Get the files of mod with mod_id

Example:

// Get the Terralith mod's files
let terralith_files = curseforge.get_mod_files(513688).await?;
// Check that the latest file is downloadable
assert!(terralith_files[0].is_available);

Get the file with file_id of mod with mod_id

Example:

// Get the Terralith mod's v2.0.12 file
let terralith_file = curseforge.get_mod_file(513688, 3606078).await?;
// Check that it contains the version in the file name
assert!(terralith_file.file_name.contains("v2.0.12"));

Get the changelog of the file with file_id of mod with mod_id

Example:

// Get the Terralith mod's v2.0.12 file's changelog
let terralith_file_changelog = curseforge.get_mod_file_changelog(513688, 3606078).await?;
// This update had huge performance updates so check that that is mentioned in the changelog
assert!(terralith_file_changelog.contains("performance"));

Get the download URL of the file with file_id of mod with mod_id

Example:

// Get information about the file
let terralith_mod_file = curseforge.get_mod_file(513688, 3606078).await?;
// Get the file's download url
let download_url = curseforge.file_download_url(513688, 3606078).await?;
// They should be the same url
assert!(Some(download_url.to_string()) == terralith_mod_file.download_url);

Get mod with ID mod_id

Example:

// Get the Terralith mod
let terralith_mod = curseforge.get_mod(513688).await?;
// Check that it is made by Starmute
assert!(terralith_mod.authors[0].name == "Starmute");

Get the description of mod with ID mod_id

Example:

// Get the Terralith mod's description
let terralith_mod_description = curseforge.get_mod_description(513688).await?;
// The description would obviously contains the mod's name
assert!(terralith_mod_description.contains("Terralith"));

Create a new API instance

api_key should be a CurseForge API key. You can obtain one by applying here

let curseforge = Furse::new(env!("CURSEFORGE_API_KEY"));

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more