pub struct AmendmentDraft {
pub amendment: Amendment,
pub texts: AmendmentTexts,
}Expand description
An Amendment and the texts it commits to: what a writer appends,
the first as the entry’s data and the second beside it
Fields§
§amendment: Amendment§texts: AmendmentTextsImplementations§
Source§impl AmendmentDraft
impl AmendmentDraft
Sourcepub fn new(
target: GovernanceLogId,
target_entry_hash: Sha256Hex,
kind: AmendmentKind,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
) -> Result<Self, AmendmentError>
pub fn new( target: GovernanceLogId, target_entry_hash: Sha256Hex, kind: AmendmentKind, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, ) -> Result<Self, AmendmentError>
Sourcepub fn redaction(
amendment_id: &GovernanceLogId,
target: GovernanceLogId,
target_entry_hash: Sha256Hex,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
fields: Vec<String>,
data: &Value,
blind: Blind,
revisions: &[&Revision],
) -> Result<(Self, Value), RedactError>
pub fn redaction( amendment_id: &GovernanceLogId, target: GovernanceLogId, target_entry_hash: Sha256Hex, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, fields: Vec<String>, data: &Value, blind: Blind, revisions: &[&Revision], ) -> Result<(Self, Value), RedactError>
A redaction of fields from the target’s data, with the redacted
data it commits to.
amendment_id is the id this amendment will be appended under: the
marker left behind names it, so the redaction says who ordered it.
Append both together or neither — the returned data is what the
target’s row must hold for verify_chain to accept it. blind
is the target’s new Blind: random, so a
rehearsal’s resulting_data_hash is not the real one’s.
revisions are the target’s, in chain order. They are rebased over
the redacted data, which must still take every patch, and a value
they removed as a duplicate of a redacted one is redacted from the
stored original too: fields is extended with it, or the erased
text would still be readable as first signed.
Sourcepub fn revision(
target: GovernanceLogId,
target_type: GovernanceLogEntryType,
target_entry_hash: Sha256Hex,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
latest: &Value,
edit: impl Into<Edit>,
) -> Result<(Self, Value), ReviseError>
pub fn revision( target: GovernanceLogId, target_type: GovernanceLogEntryType, target_entry_hash: Sha256Hex, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, latest: &Value, edit: impl Into<Edit>, ) -> Result<(Self, Value), ReviseError>
A revision of the target by edit (a patch, or
Revision::remove_duplicates), applied to its latest version
(see latest); returns the next version it commits to.
Nothing is written to the target. A patch that adds content (add
or replace) to a target without a Blind adds one too, so the
public resulting_data_hash cannot confirm a guess at text a later
redaction removes; copy and move add nothing that was not
already covered by the entry’s own hash. A patch may not touch an
existing blind.
Sourcepub fn obligation(
target: GovernanceLogId,
target_entry_hash: Sha256Hex,
update: ObligationUpdate,
basis: impl Into<CommittedText>,
note: impl Into<CommittedText>,
) -> Self
pub fn obligation( target: GovernanceLogId, target_entry_hash: Sha256Hex, update: ObligationUpdate, basis: impl Into<CommittedText>, note: impl Into<CommittedText>, ) -> Self
An amendment to an obligation, of the kind update is
The draft with the governance entry that authorizes it
Sourcepub fn with_rationale(self, rationale: impl Into<CommittedText>) -> Self
pub fn with_rationale(self, rationale: impl Into<CommittedText>) -> Self
The draft with its rationale
Trait Implementations§
Source§impl Clone for AmendmentDraft
impl Clone for AmendmentDraft
Source§impl Debug for AmendmentDraft
impl Debug for AmendmentDraft
impl Eq for AmendmentDraft
Source§impl PartialEq for AmendmentDraft
impl PartialEq for AmendmentDraft
impl StructuralPartialEq for AmendmentDraft
Auto Trait Implementations§
impl Freeze for AmendmentDraft
impl RefUnwindSafe for AmendmentDraft
impl Send for AmendmentDraft
impl Sync for AmendmentDraft
impl Unpin for AmendmentDraft
impl UnsafeUnpin for AmendmentDraft
impl UnwindSafe for AmendmentDraft
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.