Struct fog_pack::document::Document[][src]

pub struct Document(_);

Holds serialized data optionally adhering to a schema.

A Document holds a piece of serialized data, which may be deserialized by calling deserialize. If it adheres to a schema, Entries may also be attached to it, in accordance with the schema.

Implementations

impl Document[src]

pub fn schema_hash(&self) -> Option<&Hash>[src]

Get the hash of the schema this document adheres to.

pub fn signer(&self) -> Option<&Identity>[src]

Get the Identity of the signer of this document, if the document is signed.

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

Get the hash of the complete document. This can change if the document is signed again with the sign function.

pub fn deserialize<'de, D: Deserialize<'de>>(&'de self) -> Result<D>[src]

Attempt to deserialize the data into anything implementing Deserialize.

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. This only has meaning when the document is re-encoded.

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.

Trait Implementations

impl Clone for Document[src]

impl Debug for Document[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> Same<T> for T

type Output = T

Should always be Self

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