pub struct NewDocument(/* private fields */);Expand description
Implementations§
Source§impl NewDocument
impl NewDocument
Sourcepub fn new<S: Serialize>(schema: Option<&Hash>, data: S) -> Result<Self>
pub fn new<S: Serialize>(schema: Option<&Hash>, data: S) -> Result<Self>
Create a new Document from any serializable data, optionally adhering to a schema.
Sourcepub fn new_ordered<S: Serialize>(data: S, schema: Option<&Hash>) -> Result<Self>
pub fn new_ordered<S: Serialize>(data: S, schema: Option<&Hash>) -> Result<Self>
Create a new Document 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.
Sourcepub fn schema_hash(&self) -> Option<&Hash>
pub fn schema_hash(&self) -> Option<&Hash>
Get the hash of the schema this document adheres to.
Sourcepub fn compression(self, setting: Option<u8>) -> Self
pub fn compression(self, setting: Option<u8>) -> Self
Override the default compression settings. None will disable compression. Some(level)
will compress with the provided level as the setting for the algorithm.
Sourcepub fn sign(self, key: &IdentityKey) -> Result<Self>
pub fn sign(self, key: &IdentityKey) -> Result<Self>
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.
Trait Implementations§
Source§impl Clone for NewDocument
impl Clone for NewDocument
Source§fn clone(&self) -> NewDocument
fn clone(&self) -> NewDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more