Skip to main content

Item

Trait Item 

Source
pub trait Item: DeserializeOwned {
    type Id: ItemId;

    // Required method
    fn id(&self) -> Self::Id;

    // Provided method
    fn endpoint() -> &'static str { ... }
}
Expand description

Trait for items that can be managed via the Paperless API.

Required Associated Types§

Source

type Id: ItemId

The ID type for this item.

Required Methods§

Source

fn id(&self) -> Self::Id

Returns the ID of this item.

Provided Methods§

Source

fn endpoint() -> &'static str

Returns the API endpoint for this item.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§