Skip to main content

Change

Struct Change 

Source
pub struct Change {
    pub kind: String,
    pub title: String,
    pub details: HashMap<String, Value>,
    pub environment: Option<String>,
    pub service: Option<String>,
    pub actor: Option<String>,
    pub url: Option<String>,
    pub id: Option<String>,
    pub occurred_at: Option<SystemTime>,
}
Expand description

One change to record with record_change: a flag flip, a config edit, a migration, a deploy of infrastructure. Build one with Change::new and set whichever optional fields apply with struct update syntax:

use forge_ops_tracker::{context, Change};

forge_ops_tracker::record_change(Change {
    details: context! {"flag" => "new_checkout", "enabled" => true},
    actor: Some("alice@example.com".to_string()),
    ..Change::new("feature_flag", "Enabled new checkout for everyone")
});

Fields§

§kind: String

One of "feature_flag", "config", "migration", "dependency", "infrastructure", "other"; anything else is sent as "other".

§title: String

Required; truncated to 200 characters. A blank title is dropped, since it can’t be stored.

§details: HashMap<String, Value>§environment: Option<String>

Defaults to Configuration.environment.

§service: Option<String>§actor: Option<String>§url: Option<String>

A link to the change itself: a pull request, a flag’s settings page. http or https.

§id: Option<String>

An idempotency key: recording the same id twice stores one change.

§occurred_at: Option<SystemTime>

Defaults to now.

Implementations§

Source§

impl Change

Source

pub fn new(kind: &str, title: &str) -> Self

Trait Implementations§

Source§

impl Clone for Change

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Change

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Change

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Change

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.