pub enum ChargeKey {
Print {
print_id: PrintId,
tool: i64,
segment: u32,
},
Unobserved {
origin: String,
file_name: String,
generation: u32,
print_number: i64,
tool: i64,
},
}Expand description
The durable identity of one debit, so that a replay can never debit twice.
Variants§
One segment of a print this system watched, on one tool.
Fields
Unobserved
One print this system never saw, on one tool.
Implementations§
Source§impl ChargeKey
impl ChargeKey
Sourcepub fn canonical(&self) -> String
pub fn canonical(&self) -> String
The one spelling this key is stored under.
print:<print_id>:<tool>:<segment> for a watched print and
unobserved:<origin>:<generation>:<print_number>:<tool>:<file_name>
for one this system never saw — the file name last, because it is the
one part that may itself carry a colon.
Source§impl ChargeKey
impl ChargeKey
Sourcepub const fn watched_print(&self) -> Option<PrintId>
pub const fn watched_print(&self) -> Option<PrintId>
The watched print the debit is for, when the key names one.
Sourcepub const fn print_segment(&self) -> Option<PrintSegmentKey>
pub const fn print_segment(&self) -> Option<PrintSegmentKey>
The print segment this key names, when it names one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChargeKey
impl<'de> Deserialize<'de> for ChargeKey
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
impl Eq for ChargeKey
Source§impl JsonSchema for ChargeKey
impl JsonSchema for ChargeKey
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Sample for ChargeKey
impl Sample for ChargeKey
Source§fn sample_full() -> Self
fn sample_full() -> Self
A value carrying every field the type declares.
Source§fn sample_alternates() -> Vec<Self>
fn sample_alternates() -> Vec<Self>
One value per further arm, for a type whose wire form is a union. Read more
Source§fn sample_minimal() -> Self
fn sample_minimal() -> Self
A value carrying every optional field absent.
impl StructuralPartialEq for ChargeKey
Auto Trait Implementations§
impl Forget for ChargeKey
impl Freeze for ChargeKey
impl Move for ChargeKey
impl RefUnwindSafe for ChargeKey
impl Send for ChargeKey
impl Sync for ChargeKey
impl Unpin for ChargeKey
impl UnsafeUnpin for ChargeKey
impl UnwindSafe for ChargeKey
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