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

pub struct Commit {
    pub subject: String,
    pub created_at: u64,
    pub signer: String,
    pub set: Option<HashMap<String, String>>,
    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: u64

The date it was created, as a unix timestamp

signer: String

The URL of the one signing this Commit

set: Option<HashMap<String, String>>

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 into_resource<'a>(
    self,
    store: &'a dyn Storelike
) -> AtomicResult<Resource<'a>>
[src]

Converts the Commit into a HashMap of strings. Creates an identifier using the base_url or a default.

pub fn serialize_deterministically(&self) -> AtomicResult<String>[src]

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

Trait Implementations

impl Debug for Commit[src]

impl<'de> Deserialize<'de> for Commit[src]

impl Serialize for Commit[src]

Auto Trait Implementations

impl RefUnwindSafe for Commit

impl Send for Commit

impl Sync for Commit

impl Unpin for Commit

impl UnwindSafe for Commit

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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>,