pub struct TimestampBuilder<A: Allocator = Global> { /* private fields */ }Implementations§
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Source§impl<A: Allocator + Clone> TimestampBuilder<A>
impl<A: Allocator + Clone> TimestampBuilder<A>
Sourcepub fn new_in(alloc: A) -> TimestampBuilder<A>
pub fn new_in(alloc: A) -> TimestampBuilder<A>
Creates a new TimestampBuilder.
Sourcepub fn push_step(&mut self, op: OpCode) -> &mut Self
pub fn push_step(&mut self, op: OpCode) -> &mut Self
Pushes a new execution step without immediate data to the timestamp.
§Panics
Panics if:
- the opcode is control opcode
- the opcode is an opcode with immediate data
Sourcepub fn digest<D: DigestOpExt>(&mut self) -> &mut Self
pub fn digest<D: DigestOpExt>(&mut self) -> &mut Self
Pushes a new digest step to the timestamp.
Sourcepub fn merkle_proof<D: DigestOpExt>(
&mut self,
proof: SiblingIter<'_, D>,
) -> &mut Self
pub fn merkle_proof<D: DigestOpExt>( &mut self, proof: SiblingIter<'_, D>, ) -> &mut Self
Pushes the steps corresponding to the given Merkle proof to the timestamp.
Sourcepub fn commitment(&self, input: impl AsRef<[u8]>) -> Vec<u8, A> ⓘ
pub fn commitment(&self, input: impl AsRef<[u8]>) -> Vec<u8, A> ⓘ
Computes the commitment of the timestamp for the given input.
In this context, the commitment is the deterministic result of executing the timestamp’s linear chain of operations over the input bytes. It is computed by:
- Taking the provided
inputbytes as the initial value. - Iterating over all steps in the order they were added to the builder.
- For each step, applying its opcode to the current value together
with the step’s immediate data via
OpCode::execute_in, and using the result as the new current value.
The final value after all steps have been applied is returned as the commitment.
Sourcepub fn attest<'a, T: Attestation<'a>>(
self,
attestation: T,
) -> Result<Timestamp<A>, EncodeError>
pub fn attest<'a, T: Attestation<'a>>( self, attestation: T, ) -> Result<Timestamp<A>, EncodeError>
Finalizes the timestamp with the given attestation.
§Notes
The built timestamp does not include any input data. The input data must be
provided later using the finalize method on the Timestamp object.
Trait Implementations§
Source§impl<A: Clone + Allocator> Clone for TimestampBuilder<A>
impl<A: Clone + Allocator> Clone for TimestampBuilder<A>
Source§fn clone(&self) -> TimestampBuilder<A>
fn clone(&self) -> TimestampBuilder<A>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<A> Freeze for TimestampBuilder<A>where
A: Freeze,
impl<A> RefUnwindSafe for TimestampBuilder<A>where
A: RefUnwindSafe,
impl<A> Send for TimestampBuilder<A>where
A: Send,
impl<A> Sync for TimestampBuilder<A>where
A: Sync,
impl<A> Unpin for TimestampBuilder<A>where
A: Unpin,
impl<A> UnsafeUnpin for TimestampBuilder<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for TimestampBuilder<A>where
A: UnwindSafe + RefUnwindSafe,
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