surrealpatch/core/src/sql/v1/timeout.rs

24 lines
582 B
Rust
Raw Normal View History

use crate::sql::duration::Duration;
use revision::revisioned;
2020-06-29 15:36:01 +00:00
use serde::{Deserialize, Serialize};
use std::fmt;
use std::ops::Deref;
2020-06-29 15:36:01 +00:00
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)]
2024-01-09 15:34:52 +00:00
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub struct Timeout(pub Duration);
impl Deref for Timeout {
type Target = Duration;
fn deref(&self) -> &Self::Target {
&self.0
}
2020-06-29 15:36:01 +00:00
}
impl fmt::Display for Timeout {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TIMEOUT {}", self.0)
2020-06-29 15:36:01 +00:00
}
}