Skip to main content

RepositoryRecord

Trait RepositoryRecord 

Source
pub trait RepositoryRecord {
    type Id: Clone;
    type File: RepositoryFile;

    // Required methods
    fn resource_id(&self) -> Option<Self::Id>;
    fn title(&self) -> Option<&str>;
    fn files(&self) -> &[Self::File];
}
Expand description

Shared inspection surface for top-level resource payloads.

This trait intentionally treats embedded file lists as advisory. Some services, notably Figshare, may return partial embedded file lists on the main resource payload. Use ListResourceFiles when complete enumeration matters.

Required Associated Types§

Source

type Id: Clone

Service-specific resource identifier type.

Source

type File: RepositoryFile

Service-specific file entry type.

Required Methods§

Source

fn resource_id(&self) -> Option<Self::Id>

Returns the top-level resource identifier when it can be read directly from the payload.

Source

fn title(&self) -> Option<&str>

Returns a display title when one is available.

Source

fn files(&self) -> &[Self::File]

Returns the embedded file list on the payload.

Implementors§