pub struct Article {Show 41 fields
pub id: ArticleId,
pub title: String,
pub doi: Option<Doi>,
pub group_id: Option<u64>,
pub url: Option<Url>,
pub url_public_html: Option<Url>,
pub url_public_api: Option<Url>,
pub url_private_html: Option<Url>,
pub url_private_api: Option<Url>,
pub figshare_url: Option<Url>,
pub published_date: Option<String>,
pub modified_date: Option<String>,
pub created_date: Option<String>,
pub thumb: Option<Url>,
pub defined_type: Option<DefinedType>,
pub resource_title: Option<String>,
pub resource_doi: Option<String>,
pub citation: Option<String>,
pub confidential_reason: Option<String>,
pub embargo_type: Option<ArticleEmbargo>,
pub is_confidential: Option<bool>,
pub size: Option<u64>,
pub funding: Option<String>,
pub tags: Vec<String>,
pub version: Option<u64>,
pub is_active: Option<bool>,
pub is_metadata_record: Option<bool>,
pub metadata_reason: Option<String>,
pub status: Option<ArticleStatus>,
pub description: Option<String>,
pub is_embargoed: Option<bool>,
pub embargo_date: Option<String>,
pub is_public: Option<bool>,
pub has_linked_file: Option<bool>,
pub categories: Vec<ArticleCategory>,
pub license: Option<ArticleLicense>,
pub references: Vec<String>,
pub files: Vec<ArticleFile>,
pub authors: Vec<ArticleAuthor>,
pub custom_fields: Vec<CustomField>,
pub extra: BTreeMap<String, Value>,
}Expand description
Article payload shared across public and own article endpoints.
Fields§
§id: ArticleIdArticle identifier.
title: StringArticle title.
doi: Option<Doi>Version-specific DOI, when present.
group_id: Option<u64>Group identifier, when present.
url: Option<Url>Figshare-provided article URL, when present.
url_public_html: Option<Url>Public HTML URL, when present.
url_public_api: Option<Url>Public API URL, when present.
url_private_html: Option<Url>Private HTML URL, when present.
url_private_api: Option<Url>Private API URL, when present.
Public Figshare landing page, when present.
published_date: Option<String>Publication timestamp as returned by Figshare, when present.
modified_date: Option<String>Last modification timestamp as returned by Figshare, when present.
created_date: Option<String>Creation timestamp as returned by Figshare, when present.
thumb: Option<Url>Preview thumbnail URL, when present.
defined_type: Option<DefinedType>Typed article kind, when present.
resource_title: Option<String>Related resource title, when present.
resource_doi: Option<String>Related resource DOI, when present.
citation: Option<String>Citation string, when present.
confidential_reason: Option<String>Confidentiality reason, when present.
embargo_type: Option<ArticleEmbargo>Embargo mode, when present.
is_confidential: Option<bool>Whether the article is confidential, when present.
size: Option<u64>Total article size in bytes, when present.
funding: Option<String>Funding string, when present.
Tags, when present.
version: Option<u64>Version number, when present.
is_active: Option<bool>Whether the article is active, when present.
is_metadata_record: Option<bool>Whether the article is only a metadata record, when present.
metadata_reason: Option<String>Metadata reason, when present.
status: Option<ArticleStatus>Article status, when present.
description: Option<String>Description, when present.
is_embargoed: Option<bool>Whether the article is embargoed, when present.
embargo_date: Option<String>Embargo end timestamp, when present.
is_public: Option<bool>Whether the article is public, when present.
has_linked_file: Option<bool>Whether the article contains a linked file, when present.
categories: Vec<ArticleCategory>Attached categories.
license: Option<ArticleLicense>Attached license, when present.
references: Vec<String>Attached references.
files: Vec<ArticleFile>Attached files embedded in the article payload, when present.
Figshare caps embedded article file lists, so use dedicated file-list endpoints or the download helpers when complete enumeration matters.
Attached authors, when present.
custom_fields: Vec<CustomField>Attached custom fields, when present.
extra: BTreeMap<String, Value>Additional untyped fields preserved for forward compatibility.
Implementations§
Source§impl Article
impl Article
Sourcepub fn is_public_article(&self) -> bool
pub fn is_public_article(&self) -> bool
Returns true when the article is public according to the available
flags in the payload.
Sourcepub fn version_number(&self) -> Option<u64>
pub fn version_number(&self) -> Option<u64>
Returns the best version number visible in the payload.
Sourcepub fn file_by_name(&self, name: &str) -> Option<&ArticleFile>
pub fn file_by_name(&self, name: &str) -> Option<&ArticleFile>
Finds a file by exact file name within the embedded article payload.
Figshare may return only a partial embedded file list, so prefer the dedicated file-list endpoints when completeness matters.
§Examples
use figshare_rs::{Article, FileId};
let article: Article = serde_json::from_value(serde_json::json!({
"id": 1,
"title": "Example",
"files": [{
"id": 7,
"name": "artifact.bin",
"size": 12
}]
}))?;
let file = article.file_by_name("artifact.bin").expect("embedded file");
assert_eq!(file.id, FileId(7));Sourcepub fn file_by_id(&self, id: FileId) -> Option<&ArticleFile>
pub fn file_by_id(&self, id: FileId) -> Option<&ArticleFile>
Finds a file by ID.