Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions opsqueue/src/common/submission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ impl TryFrom<u64> for SubmissionId {
}
}

impl TryFrom<i64> for SubmissionId {
type Error = crate::common::errors::TryFromIntError;

fn try_from(value: i64) -> Result<Self, Self::Error> {
if value < 0 {
return Err(crate::common::errors::TryFromIntError(()));
}

Ok(Self(u63::new(value as u64)))
}
}

impl From<&SubmissionId> for std::time::SystemTime {
fn from(val: &SubmissionId) -> Self {
val.system_time()
Expand Down
Loading