Skip to main content

Item

Trait Item 

Source
pub trait Item {
    type Id: PaperlessId;
    type BaseType: DeserializeOwned;
    type CreateDto: CreateDtoObject;
    type UpdateDto: UpdateDtoObject;

    // Required methods
    fn endpoint() -> &'static str;
    fn id(&self) -> Self::Id;
}
Expand description

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

Required Associated Types§

Source

type Id: PaperlessId

The ID type for this item.

Source

type BaseType: DeserializeOwned

The base type used for deserialization.

Source

type CreateDto: CreateDtoObject

The DTO type used for creating new items.

Source

type UpdateDto: UpdateDtoObject

The DTO type used for updating existing items.

Required Methods§

Source

fn endpoint() -> &'static str

Returns the API endpoint for this item.

Source

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

Returns the ID of this item.

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.

Implementors§