pub trait DraftWorkflow: ClientContext {
type Draft: DraftResource;
type Metadata;
type Upload;
type FilePolicy;
type UploadResult;
type Published;
// Required methods
fn create_draft(
&self,
metadata: &Self::Metadata,
) -> impl Future<Output = Result<Self::Draft, Self::Error>>;
fn update_draft_metadata(
&self,
draft_id: &<Self::Draft as DraftResource>::Id,
metadata: &Self::Metadata,
) -> impl Future<Output = Result<Self::Draft, Self::Error>>;
fn reconcile_draft_files(
&self,
draft: &Self::Draft,
policy: Self::FilePolicy,
uploads: Vec<Self::Upload>,
) -> impl Future<Output = Result<Vec<Self::UploadResult>, Self::Error>>;
fn publish_draft(
&self,
draft_id: &<Self::Draft as DraftResource>::Id,
) -> impl Future<Output = Result<Self::Published, Self::Error>>;
}Expand description
Lower-level mutable-draft workflow shared most directly by Zenodo and Figshare.
Required Associated Types§
Sourcetype Draft: DraftResource
type Draft: DraftResource
Service-specific mutable draft type.
Sourcetype FilePolicy
type FilePolicy
Service-specific draft file policy.
Sourcetype UploadResult
type UploadResult
Service-specific upload result type.
Required Methods§
Sourcefn create_draft(
&self,
metadata: &Self::Metadata,
) -> impl Future<Output = Result<Self::Draft, Self::Error>>
fn create_draft( &self, metadata: &Self::Metadata, ) -> impl Future<Output = Result<Self::Draft, Self::Error>>
Creates a new mutable draft-like resource with the supplied metadata.
Sourcefn update_draft_metadata(
&self,
draft_id: &<Self::Draft as DraftResource>::Id,
metadata: &Self::Metadata,
) -> impl Future<Output = Result<Self::Draft, Self::Error>>
fn update_draft_metadata( &self, draft_id: &<Self::Draft as DraftResource>::Id, metadata: &Self::Metadata, ) -> impl Future<Output = Result<Self::Draft, Self::Error>>
Replaces or merges the draft metadata.
Sourcefn reconcile_draft_files(
&self,
draft: &Self::Draft,
policy: Self::FilePolicy,
uploads: Vec<Self::Upload>,
) -> impl Future<Output = Result<Vec<Self::UploadResult>, Self::Error>>
fn reconcile_draft_files( &self, draft: &Self::Draft, policy: Self::FilePolicy, uploads: Vec<Self::Upload>, ) -> impl Future<Output = Result<Vec<Self::UploadResult>, Self::Error>>
Reconciles the draft file set under the requested policy.
Sourcefn publish_draft(
&self,
draft_id: &<Self::Draft as DraftResource>::Id,
) -> impl Future<Output = Result<Self::Published, Self::Error>>
fn publish_draft( &self, draft_id: &<Self::Draft as DraftResource>::Id, ) -> impl Future<Output = Result<Self::Published, Self::Error>>
Publishes the draft-like resource.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.