pub struct EntryBuilder<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State: State> EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State: State> EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
Sourcepub fn build(self) -> Entry<MCL, MCC, MPL, N, S, PD>where
State: IsComplete,
pub fn build(self) -> Entry<MCL, MCC, MPL, N, S, PD>where
State: IsComplete,
Finish building and return the requested object
Sourcepub fn namespace_id(
self,
value: N,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetNamespaceId<State>>
pub fn namespace_id( self, value: N, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetNamespaceId<State>>
Required.
Sourcepub fn subspace_id(
self,
value: S,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetSubspaceId<State>>
pub fn subspace_id( self, value: S, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetSubspaceId<State>>
Required.
Sourcepub fn path(
self,
value: Path<MCL, MCC, MPL>,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPath<State>>
pub fn path( self, value: Path<MCL, MCC, MPL>, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPath<State>>
Required.
Sourcepub fn timestamp(
self,
value: impl Into<Timestamp>,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetTimestamp<State>>
pub fn timestamp( self, value: impl Into<Timestamp>, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetTimestamp<State>>
Required.
Sourcepub fn payload_length(
self,
value: u64,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<State>>
pub fn payload_length( self, value: u64, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<State>>
Required.
Sourcepub fn payload_digest(
self,
value: PD,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadDigest<State>>
pub fn payload_digest( self, value: PD, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadDigest<State>>
Required.
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State: State> EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State: State> EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
Sourcepub fn now(
self,
) -> Result<EntryBuilder<MCL, MCC, MPL, N, S, PD, SetTimestamp<State>>, HifitimeError>
pub fn now( self, ) -> Result<EntryBuilder<MCL, MCC, MPL, N, S, PD, SetTimestamp<State>>, HifitimeError>
Sets the timestamp of the entry being built to the current time.
Sourcepub fn payload<Payload, H, Digest>(
self,
payload: Payload,
) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<SetPayloadDigest<State>>>
pub fn payload<Payload, H, Digest>( self, payload: Payload, ) -> EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<SetPayloadDigest<State>>>
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.
Sourcepub async fn payload_async<P, H, Digest>(
self,
payload_producer: &mut P,
) -> Result<EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<SetPayloadDigest<State>>>, P::Error>
pub async fn payload_async<P, H, Digest>( self, payload_producer: &mut P, ) -> Result<EntryBuilder<MCL, MCC, MPL, N, S, PD, SetPayloadLength<SetPayloadDigest<State>>>, P::Error>
Sets the payload_length and payload_digest of the entry being built to those of the payload given by the producer.
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.
Auto Trait Implementations§
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State = Empty> !Freeze for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> RefUnwindSafe for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> Send for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> Sync for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> Unpin for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> UnsafeUnpin for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, State> UnwindSafe for EntryBuilder<MCL, MCC, MPL, N, S, PD, State>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more