Struct fog_pack::document::NewDocument [−][src]
A new Document that has not yet been validated.
This struct acts like a Document, but cannot be decoded until it has passed through either a
Schema or through NoSchema.
Implementations
impl NewDocument[src]
pub fn new<S: Serialize>(data: S, schema: Option<&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, schema: Option<&Hash>) -> Result<Self>[src]
Create a new Entry from 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 schema_hash(&self) -> Option<&Hash>[src]
Get the hash of the schema this document adheres to.
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. In the event of a failure, the document is dropped.
pub fn hash(&self) -> Hash[src]
Get what the document’s hash will be, given its current state
Trait Implementations
impl Clone for NewDocument[src]
fn clone(&self) -> NewDocument[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for NewDocument[src]
Auto Trait Implementations
impl RefUnwindSafe for NewDocument
impl Send for NewDocument
impl Sync for NewDocument
impl Unpin for NewDocument
impl UnwindSafe for NewDocument
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,