Struct atomic_lib::commit::Commit[][src]

pub struct Commit {
    pub subject: String,
    pub created_at: i64,
    pub signer: String,
    pub set: Option<HashMap<String, Value>>,
    pub remove: Option<Vec<String>>,
    pub destroy: Option<bool>,
    pub signature: Option<String>,
}

A Commit is a set of changes to a Resource. Use CommitBuilder if you're programmatically constructing a Delta.

Fields

subject: String

The subject URL that is to be modified by this Delta

created_at: i64

The date it was created, as a unix timestamp

signer: String

The URL of the one signing this Commit

set: Option<HashMap<String, Value>>

The set of PropVals that need to be added. Overwrites existing values

remove: Option<Vec<String>>

The set of property URLs that need to be removed

destroy: Option<bool>

If set to true, deletes the entire resource

signature: Option<String>

Base64 encoded signature of the JSON serialized Commit

Implementations

impl Commit[src]

pub fn from_resource(resource: Resource) -> AtomicResult<Commit>[src]

Converts a Resource of a Commit into a Commit

pub fn into_resource(self, store: &impl Storelike) -> AtomicResult<Resource>[src]

Converts the Commit into a Resource with Atomic Values. Creates an identifier using the base_url Works for both Signed and Unsigned Commits

pub fn get_subject(&self) -> &str[src]

pub fn serialize_deterministically_json_ad(
    &self,
    store: &impl Storelike
) -> AtomicResult<String>
[src]

Generates a deterministic serialized JSON-AD representation of the Commit. Does not contain the signature, since this function is used to check if the signature is correct.

Trait Implementations

impl Clone for Commit[src]

impl Debug for Commit[src]

impl Serialize for Commit[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,