[][src]Struct fog_pack::Entry

pub struct Entry { /* fields omitted */ }

A fog-pack value that can be signed and compressed, with an associated document hash and field.

Implementations

impl Entry[src]

pub fn new(doc: Hash, field: String, v: Value) -> Result<Entry, ()>[src]

Create a new entry from a given Value. Fails if the resulting entry is larger than the maximum allowed size.

pub fn sign(&mut self, vault: &Vault, key: &Key) -> Result<(), CryptoError>[src]

Sign the entry with a given Key from a given Vault. Fails if the key is invalid (BadKey), can't be found (NotInStorage), or the resulting entry is larger than the maximum allowed entry size.

pub fn set_compression(&mut self, compression: Option<i32>)[src]

Specifically set compression, overriding default schema settings. If None, no compression will be used. If some i32, the value will be passed to the zstd compressor. Note: if the document has no schema settings, it defaults to generic compression with default zstd settings.

pub fn reset_compression(&mut self)[src]

Remove any overrides on the compression settings set by set_compression.

pub fn signed_by(&self) -> Iter<Identity>[src]

Get an iterator over all known signers of the document.

pub fn len(&self) -> usize[src]

Get the length of the entry (minus document hash & field name) prior to encoding

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

Get the Hash of the Entry as it currently is. Note that adding additional signatures will change the Hash.

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

Get the Hash of the parent document for the Entry.

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

Get the field for this entry.

pub fn compression(&self) -> Option<i32>[src]

Returns the compression setting that will be used if the compression is overridden. Check override status with override_compression.

pub fn override_compression(&self) -> bool[src]

Returns true if compression is being overridden. If true, the setting returned by compression will be used.

pub fn validated(&self) -> bool[src]

Returns true if the document has previously been validated by a schema or the general fog-pack validator. This is always true on Documents that were decoded from raw byte slices.

pub fn value(&self) -> ValueRef[src]

Retrieve the value stored inside the entry as a ValueRef. This value has the same lifetime as the Entry; it can be converted to a Value if it needs to outlast the Entry.

Trait Implementations

impl Clone for Entry[src]

impl Eq for Entry[src]

impl PartialEq<Entry> for Entry[src]

Auto Trait Implementations

impl RefUnwindSafe for Entry

impl Send for Entry

impl Sync for Entry

impl Unpin for Entry

impl UnwindSafe for Entry

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.