Skip to main content

ora_backend/
executors.rs

1//! Executor definitions and related types.
2
3use serde::{Deserialize, Serialize};
4use uuid::Uuid;
5
6/// An executor ID.
7#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
8#[repr(transparent)]
9#[serde(transparent)]
10pub struct ExecutorId(pub Uuid);
11
12impl From<Uuid> for ExecutorId {
13    fn from(value: Uuid) -> Self {
14        Self(value)
15    }
16}
17
18impl From<ExecutorId> for Uuid {
19    fn from(value: ExecutorId) -> Self {
20        value.0
21    }
22}
23
24impl std::fmt::Display for ExecutorId {
25    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26        write!(f, "{}", self.0)
27    }
28}