pub struct RealtimePayloadEnvelope<P> { /* private fields */ }Expand description
One opaque payload bound to an exact coordinate and semantic contract.
Implementations§
Source§impl<P> RealtimePayloadEnvelope<P>
impl<P> RealtimePayloadEnvelope<P>
Sourcepub fn new(
contract: RealtimePayloadContract,
coordinate: RealtimeSlotCoordinate,
payload: P,
) -> Result<Self, RealtimePayloadContractError>
pub fn new( contract: RealtimePayloadContract, coordinate: RealtimeSlotCoordinate, payload: P, ) -> Result<Self, RealtimePayloadContractError>
Binds a payload to one admitted coordinate and its contract-derived token domain.
Sourcepub const fn contract(&self) -> &RealtimePayloadContract
pub const fn contract(&self) -> &RealtimePayloadContract
Returns the exact semantic payload contract.
Sourcepub const fn coordinate(&self) -> RealtimeSlotCoordinate
pub const fn coordinate(&self) -> RealtimeSlotCoordinate
Returns the exact delayed-frame coordinate.
Sourcepub const fn domain(&self) -> TokenDomain
pub const fn domain(&self) -> TokenDomain
Returns the token domain derived from the coordinate slot and contract.
Sourcepub fn validate(
&self,
contract: &RealtimePayloadContract,
coordinate: RealtimeSlotCoordinate,
) -> Result<(), RealtimePayloadContractError>
pub fn validate( &self, contract: &RealtimePayloadContract, coordinate: RealtimeSlotCoordinate, ) -> Result<(), RealtimePayloadContractError>
Validates handoff against another exact contract and coordinate.
Sourcepub fn into_parts(
self,
) -> (RealtimePayloadContract, RealtimeSlotCoordinate, TokenDomain, P)
pub fn into_parts( self, ) -> (RealtimePayloadContract, RealtimeSlotCoordinate, TokenDomain, P)
Consumes the envelope into its contract, coordinate, derived domain, and payload.
Trait Implementations§
Source§impl<P: Clone> Clone for RealtimePayloadEnvelope<P>
impl<P: Clone> Clone for RealtimePayloadEnvelope<P>
Source§fn clone(&self) -> RealtimePayloadEnvelope<P>
fn clone(&self) -> RealtimePayloadEnvelope<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: Debug> Debug for RealtimePayloadEnvelope<P>
impl<P: Debug> Debug for RealtimePayloadEnvelope<P>
impl<P: Eq> Eq for RealtimePayloadEnvelope<P>
Source§impl<P: PartialEq> PartialEq for RealtimePayloadEnvelope<P>
impl<P: PartialEq> PartialEq for RealtimePayloadEnvelope<P>
impl<P: PartialEq> StructuralPartialEq for RealtimePayloadEnvelope<P>
Auto Trait Implementations§
impl<P> Freeze for RealtimePayloadEnvelope<P>where
P: Freeze,
impl<P> RefUnwindSafe for RealtimePayloadEnvelope<P>where
P: RefUnwindSafe,
impl<P> Send for RealtimePayloadEnvelope<P>where
P: Send,
impl<P> Sync for RealtimePayloadEnvelope<P>where
P: Sync,
impl<P> Unpin for RealtimePayloadEnvelope<P>where
P: Unpin,
impl<P> UnsafeUnpin for RealtimePayloadEnvelope<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for RealtimePayloadEnvelope<P>where
P: 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