pub struct Builder<E> { /* private fields */ }Expand description
Build & sign operations.
Implementations§
Source§impl<E> Builder<E>where
E: Extensions,
impl<E> Builder<E>where
E: Extensions,
pub fn new() -> Self
Sourcepub fn chain(self, seq_num: SeqNum, backlink: Hash) -> Self
pub fn chain(self, seq_num: SeqNum, backlink: Hash) -> Self
Sets the “hash chain” values of this operation: sequence number and backlink.
Sourcepub fn seq_num(self, seq_num: SeqNum) -> Self
pub fn seq_num(self, seq_num: SeqNum) -> Self
Number of operations this author has published to this log, begins with 0 and is always incremented by 1 with each new operation by the same author.
Sourcepub fn backlink(self, backlink: Option<Hash>) -> Self
pub fn backlink(self, backlink: Option<Hash>) -> Self
Hash of the previous operation of the same author and log. Can be omitted if first operation in log.
Sourcepub fn build(self, signing_key: &SigningKey, extensions: E) -> Header<E>
pub fn build(self, signing_key: &SigningKey, extensions: E) -> Header<E>
Encodes, signs and returns final header of operation.
A custom header extensions type can be set here as well when required. It will be embedded
in the header. Set this to () (unit-type) when extensions are not necessary.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Builder<E>
impl<E> RefUnwindSafe for Builder<E>where
E: RefUnwindSafe,
impl<E> Send for Builder<E>where
E: Send,
impl<E> Sync for Builder<E>where
E: Sync,
impl<E> Unpin for Builder<E>where
E: Unpin,
impl<E> UnsafeUnpin for Builder<E>
impl<E> UnwindSafe for Builder<E>where
E: UnwindSafe,
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
Mutably borrows from an owned value. Read more