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
sourceimpl Furse
impl Furse
sourcepub async fn get_mod_files(&self, mod_id: ID) -> Result<Vec<File>, Error>
pub async fn get_mod_files(&self, mod_id: ID) -> Result<Vec<File>, Error>
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);sourcepub async fn get_mod_file(&self, mod_id: ID, file_id: ID) -> Result<File, Error>
pub async fn get_mod_file(&self, mod_id: ID, file_id: ID) -> Result<File, Error>
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"));sourcepub async fn get_mod_file_changelog(
&self,
mod_id: ID,
file_id: ID
) -> Result<String, Error>
pub async fn get_mod_file_changelog(
&self,
mod_id: ID,
file_id: ID
) -> Result<String, Error>
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"));sourcepub async fn file_download_url(
&self,
mod_id: ID,
file_id: ID
) -> Result<Url, Error>
pub async fn file_download_url(
&self,
mod_id: ID,
file_id: ID
) -> Result<Url, Error>
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);sourceimpl Furse
impl Furse
sourcepub async fn get_mod(&self, mod_id: ID) -> Result<Mod, Error>
pub async fn get_mod(&self, mod_id: ID) -> Result<Mod, Error>
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");sourcepub async fn get_mod_description(&self, mod_id: ID) -> Result<String, Error>
pub async fn get_mod_description(&self, mod_id: ID) -> Result<String, Error>
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"));Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Furse
impl Send for Furse
impl Sync for Furse
impl Unpin for Furse
impl !UnwindSafe for Furse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more