Struct fog_pack::entry::NewEntry[][src]

pub struct NewEntry { /* fields omitted */ }

A new Entry that has not yet been validated.

This struct acts like an Entry, but cannot be decoded until it has passed through a Schema.

Implementations

impl NewEntry[src]

pub fn new<S: Serialize>(data: S, key: &str, parent: &Hash) -> Result<Self>[src]

Create a new Entry from any serializable data, a key, and the Hash of the parent document.

pub fn new_ordered<S: Serialize>(
    data: S,
    key: &str,
    parent: &Hash
) -> Result<Self>
[src]

Create a new Entry from a key, the Hash of the parent document, and any serializable data whose keys are all ordered. For structs, this means all fields are declared in lexicographic order. For maps, this means a BTreeMap type must be used, whose keys are ordered such that they serialize to lexicographically ordered strings. All sub-structs and sub-maps must be similarly ordered.

pub fn compression(self, setting: Option<u8>) -> Self[src]

Override the default compression settings. None will disable compression. Some(level) will compress with the provided level as the setting for the algorithm.

pub fn sign(self, key: &IdentityKey) -> Result<Self>[src]

Sign the document, or or replace the existing signature if one exists already. Fails if the signature would grow the document size beyond the maximum allowed.

pub fn hash(&self) -> Hash[src]

Get what the document’s hash will be, given its current state

pub fn parent(&self) -> &Hash[src]

Get the hash of the Entry’s parent Document.

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

Get the Entry’s string key.

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> Same<T> for T

type Output = T

Should always be Self

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