Crate peace_items

source ·
Expand description

Collection of items the peace framework.

Every item crate needs to be enabled with its own feature. Example:

peace_items = { version = "0.0.3", features = ["file_download"] }

In code:

#[cfg(feature = "file_download")]
use peace::cfg::{item_id, ItemId};
use peace_items::file_download::FileDownloadItem;

/// Marker type for `FileDownloadParams`.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct MyFileId;

let file_download_item =
    FileDownloadItem::<MyFileId>::new(item_id!("file_to_download"));
#[cfg(not(feature = "file_download"))]

Re-exports§