pub struct NewEntry(/* private fields */);Expand description
A new Entry that has not yet been validated.
This struct acts like an Entry, but cannot be decoded until it has passed through a
Schema.
Implementations§
Source§impl NewEntry
impl NewEntry
Sourcepub fn new<S: Serialize>(key: &str, parent: &Document, data: S) -> Result<Self>
pub fn new<S: Serialize>(key: &str, parent: &Document, data: S) -> Result<Self>
Create a new Entry from any serializable data, a key, and the Hash of the parent document.
Sourcepub fn new_ordered<S: Serialize>(
data: S,
key: &str,
parent: &Document,
) -> Result<Self>
pub fn new_ordered<S: Serialize>( data: S, key: &str, parent: &Document, ) -> Result<Self>
Create a new Entry from a key, the Hash of the parent document, and 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 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.