pub struct TicketDraft {
pub idempotency_key: String,
pub title: String,
pub body_markdown: String,
pub severity: Severity,
pub labels: Vec<String>,
pub environment: Option<String>,
}Expand description
A ticket to file, in tracker-neutral terms: every adapter maps the
fields its protocol has and documents what it drops. title and
body_markdown are the only content every tracker takes; labels and
environment are requests an adapter may flatten into the body, a
label list, or nothing.
Fields§
§idempotency_key: StringMakes the file idempotent under retries; the caller owns its shape. A tracker that has already accepted this key answers with the existing ticket instead of a duplicate (an adapter may also enforce it with an idempotency header where the API has one).
title: StringThe ticket’s title, one line.
body_markdown: StringThe ticket’s body, Markdown. Adapters translate or quote it verbatim per their tracker’s format and say which.
severity: SeverityHow urgent the ticket is.
labels: Vec<String>Free-form labels. A tracker without labels carries them in the body.
environment: Option<String>The deployment the ticket is about ("production", "eu-1"), when
the caller knows one.
Implementations§
Source§impl TicketDraft
impl TicketDraft
Sourcepub fn new(
idempotency_key: impl Into<String>,
title: impl Into<String>,
body_markdown: impl Into<String>,
severity: Severity,
) -> Self
pub fn new( idempotency_key: impl Into<String>, title: impl Into<String>, body_markdown: impl Into<String>, severity: Severity, ) -> Self
A minimal draft: the idempotency key, a title, a body and a severity. Labels and environment are added by the chaining setters.
Sourcepub fn environment(self, environment: impl Into<String>) -> Self
pub fn environment(self, environment: impl Into<String>) -> Self
Sets the environment the ticket is about.
Trait Implementations§
Source§impl Clone for TicketDraft
impl Clone for TicketDraft
Source§impl Debug for TicketDraft
impl Debug for TicketDraft
impl Eq for TicketDraft
Source§impl PartialEq for TicketDraft
impl PartialEq for TicketDraft
impl StructuralPartialEq for TicketDraft
Auto Trait Implementations§
impl Freeze for TicketDraft
impl RefUnwindSafe for TicketDraft
impl Send for TicketDraft
impl Sync for TicketDraft
impl Unpin for TicketDraft
impl UnsafeUnpin for TicketDraft
impl UnwindSafe for TicketDraft
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.