pub struct StoredHandoff {
pub data: HandoffRecord,
pub status: HandoffStatus,
}Expand description
A handoff as stored in the database (status-agnostic).
When loading from the database, we don’t know the state at compile time.
Use the into_* methods to validate and convert to a typed handoff.
Fields§
§data: HandoffRecord§status: HandoffStatusImplementations§
Source§impl StoredHandoff
impl StoredHandoff
Sourcepub fn into_typed(self) -> LoadedHandoff
pub fn into_typed(self) -> LoadedHandoff
Convert to a typed handoff based on the stored status.
Sourcepub fn into_initiated(self) -> Result<Handoff<Initiated>, HandoffStateError>
pub fn into_initiated(self) -> Result<Handoff<Initiated>, HandoffStateError>
Try to convert to an initiated handoff.
Sourcepub fn into_accepted(
self,
) -> Result<Handoff<HandoffAccepted>, HandoffStateError>
pub fn into_accepted( self, ) -> Result<Handoff<HandoffAccepted>, HandoffStateError>
Try to convert to an accepted handoff.
Sourcepub fn data(&self) -> &HandoffRecord
pub fn data(&self) -> &HandoffRecord
Get the underlying data without state validation.
Sourcepub fn status(&self) -> HandoffStatus
pub fn status(&self) -> HandoffStatus
Get the current status.
Trait Implementations§
Source§impl Clone for StoredHandoff
impl Clone for StoredHandoff
Source§fn clone(&self) -> StoredHandoff
fn clone(&self) -> StoredHandoff
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 moreSource§impl Debug for StoredHandoff
impl Debug for StoredHandoff
Source§impl<'de> Deserialize<'de> for StoredHandoff
impl<'de> Deserialize<'de> for StoredHandoff
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StoredHandoff
impl PartialEq for StoredHandoff
Source§impl Serialize for StoredHandoff
impl Serialize for StoredHandoff
impl StructuralPartialEq for StoredHandoff
Auto Trait Implementations§
impl Freeze for StoredHandoff
impl RefUnwindSafe for StoredHandoff
impl Send for StoredHandoff
impl Sync for StoredHandoff
impl Unpin for StoredHandoff
impl UnwindSafe for StoredHandoff
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