EntryBuilder

Struct EntryBuilder 

Source
pub struct EntryBuilder<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> { /* private fields */ }
Expand description

Implementations§

Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> EntryBuilder<MCL, MCC, MPL, N, S, PD>

Source

pub fn namespace_id(&mut self, value: N) -> &mut Self

Sets the namespace_id of the entry being built.

Source

pub fn subspace_id(&mut self, value: S) -> &mut Self

Sets the subspace_id of the entry being built.

Source

pub fn path(&mut self, value: Path<MCL, MCC, MPL>) -> &mut Self

Sets the path of the entry being built.

Source

pub fn timestamp<T: Into<Timestamp>>(&mut self, value: T) -> &mut Self

Sets the timestamp of the entry being built.

Source

pub fn payload_length(&mut self, value: u64) -> &mut Self

Sets the payload_length of the entry being built.

Source

pub fn payload_digest(&mut self, value: PD) -> &mut Self

Sets the payload_digest of the entry being built.

Source

pub fn payload<Payload: AsRef<[u8]>, H, Digest>( &mut self, payload: Payload, ) -> &mut Self
where H: Default + Hasher<Digest>, Digest: Into<PD>,

Sets the payload_length and payload_digest of the entry being built to those of the given Payload.

The type parameter H is the type of the Hasher which hashes the payload into a payload digest (of type Digest: Into<PD>). Its Default impl provides the initial state of the hasher.

Source

pub fn now(&mut self) -> Result<&mut Self, HifitimeError>

Sets the timestamp of the entry being built to the current time.

Source

pub fn build( &mut self, ) -> Result<Entry<MCL, MCC, MPL, N, S, PD>, EntryBuilderError>

Builds the Entry.

Calling this method multiple times will cause a panic.

Auto Trait Implementations§

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> !Freeze for EntryBuilder<MCL, MCC, MPL, N, S, PD>

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> RefUnwindSafe for EntryBuilder<MCL, MCC, MPL, N, S, PD>

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> Send for EntryBuilder<MCL, MCC, MPL, N, S, PD>
where N: Send, S: Send, PD: Send,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> Sync for EntryBuilder<MCL, MCC, MPL, N, S, PD>
where N: Sync, S: Sync, PD: Sync,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> Unpin for EntryBuilder<MCL, MCC, MPL, N, S, PD>
where N: Unpin, S: Unpin, PD: Unpin,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD> UnwindSafe for EntryBuilder<MCL, MCC, MPL, N, S, PD>
where N: UnwindSafe, S: UnwindSafe, PD: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.