[−][src]Struct fog_pack::Entry
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,