Expand description
§client-uploader-traits
Traits defining a common generic traits surface for uploader clients such as zenodo-rs, internetarchive-rs, and figshare-rs.
It covers:
- client configuration
- upload, file, and resource inspection
- public lookup, search, and download capabilities
- create/update publication workflows
- publication outcome and search-result inspection
- small generic helpers and a
prelude
use client_uploader_traits::{
CreatePublication, CreatePublicationRequest, PublicationOutcome,
};
async fn publish<C>(
client: &C,
request: CreatePublicationRequest<C::CreateTarget, C::Metadata, C::Upload>,
) -> Result<C::Output, C::Error>
where
C: CreatePublication,
C::Output: PublicationOutcome,
{
client.create_publication(request).await
}This crate is intentionally self-contained. Real conformance tests against concrete client crates should live in those crates.
Modules§
- prelude
- Common re-exports for crate consumers and implementers.
Structs§
- Create
Publication Request - Generic request for “create a brand-new published resource”.
- NoCreate
Target - Marker used when a service creates new resources without a caller-supplied target identifier.
- Update
Publication Request - Generic request for “update or upsert an existing published resource”.
Enums§
- Draft
File Policy Kind - Normalized draft-file reconciliation semantics shared by Zenodo and Figshare.
- Existing
File Conflict Policy Kind - Normalized per-file conflict semantics shared by direct-upload services such as Internet Archive.
- Upload
Name Validation Error - Validation error returned by shared upload-name helpers.
- Upload
Source Kind - Shared classification of upload input sources.
Traits§
- Client
Context - Minimal configuration surface shared by the uploader clients.
- Core
Repository Client - Bundle for the capability set shared by all three current uploader clients.
- Create
Publication - Capability for creating and publishing a brand-new resource.
- DoiBacked
Record - Shared inspection surface for DOI-backed resources.
- DoiVersioned
Repository Client - Bundle for clients that additionally support DOI lookup and latest-version resolution.
- Download
Named Public File - Capability for downloading one named public file to a local path.
- Draft
File Policy - Shared classification trait for Zenodo/Figshare draft reconciliation policies.
- Draft
Publishing Repository Client - Bundle for clients that expose draft-oriented mutation workflows.
- Draft
Resource - Shared inspection surface for mutable draft-like resources.
- Draft
State - Shared publication-state inspection for mutable resources.
- Draft
Workflow - Lower-level mutable-draft workflow shared most directly by Zenodo and Figshare.
- Existing
File Conflict Policy - Shared classification trait for Internet Archive-style per-file conflict policies.
- List
Resource Files - Capability for enumerating files attached to a public resource.
- Lookup
ByDoi - DOI-based lookup for public resources.
- Maybe
Authenticated Client - Shared auth-state inspection surface.
- Mutable
Publication Outcome - Shared inspection surface for publication workflows that also return a mutable or private-side resource.
- Publication
Outcome - Shared inspection surface for publication workflow results.
- Read
Public Resource - Capability for reading one public resource by its primary service identifier.
- Repository
File - Shared inspection surface for remote file entries.
- Repository
Record - Shared inspection surface for top-level resource payloads.
- Resolve
Latest Public Resource - Latest-version resolution for public resources that expose version families.
- Resolve
Latest Public Resource ByDoi - Latest-version resolution for DOI-backed public resources.
- Search
Public Resources - Capability for searching public resources.
- Search
Results Like - Shared inspection surface for search result containers.
- Update
Publication - Capability for updating or upserting an existing published resource.
- Upload
Spec Like - Shared inspection surface for upload specifications.
Functions§
- collect_
upload_ filenames - Collects the set of upload filenames while validating that names are non-empty and unique.
- find_
embedded_ draft_ file_ by_ name - Returns the first embedded file on a draft payload whose name matches
name. - find_
embedded_ record_ file_ by_ name - Returns the first embedded file on a record payload whose name matches
name. - find_
file_ by_ name - Returns the first file whose name matches
name. - has_
file_ named - Returns whether any file in the iterator matches
name. - has_
upload_ filename - Returns whether any upload in the iterator targets
filename. - validate_
upload_ filenames - Validates that upload filenames are non-empty and unique.