pub struct Receipt {
pub receipt_version: String,
pub plan_id: String,
pub registry: Registry,
pub started_at: DateTime<Utc>,
pub finished_at: DateTime<Utc>,
pub packages: Vec<PackageReceipt>,
pub event_log_path: PathBuf,
pub git_context: Option<GitContext>,
pub environment: EnvironmentFingerprint,
}Expand description
Complete receipt for a publish operation.
This is the final audit document containing all evidence and metadata for a complete publish operation. It’s saved to disk after all packages are published.
§Example
ⓘ
use chrono::Utc;
use std::path::PathBuf;
use shipper::types::{Receipt, Registry, EnvironmentFingerprint};
let receipt = Receipt {
receipt_version: "shipper.receipt.v1".to_string(),
plan_id: "abc123".to_string(),
registry: Registry::crates_io(),
started_at: Utc::now(),
finished_at: Utc::now(),
packages: vec![],
event_log_path: PathBuf::from(".shipper/events.jsonl"),
git_context: None,
environment: EnvironmentFingerprint {
shipper_version: env!("CARGO_PKG_VERSION").to_string(),
cargo_version: None,
rust_version: None,
os: std::env::consts::OS.to_string(),
arch: std::env::consts::ARCH.to_string(),
},
};§Storage
Receipts are stored in the state directory and can be used for:
- Auditing past publishes
- Debugging failed publishes
- Evidence for compliance requirements
Fields§
§receipt_version: String§plan_id: String§registry: Registry§started_at: DateTime<Utc>§finished_at: DateTime<Utc>§packages: Vec<PackageReceipt>§event_log_path: PathBuf§git_context: Option<GitContext>§environment: EnvironmentFingerprintTrait Implementations§
Source§impl<'de> Deserialize<'de> for Receipt
impl<'de> Deserialize<'de> for Receipt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Receipt
impl RefUnwindSafe for Receipt
impl Send for Receipt
impl Sync for Receipt
impl Unpin for Receipt
impl UnsafeUnpin for Receipt
impl UnwindSafe for Receipt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more