pddl/types/
length_spec.rs

1//! Contains the [`LengthSpec`] type.
2
3/// Deprecated since PDDL 2.1.
4///
5/// ## Usage
6/// Used by [`Problem`](crate::Problem).
7#[derive(Debug, Default, Clone, Eq, PartialEq)]
8pub struct LengthSpec {
9    serial: Option<u64>,
10    parallel: Option<u64>,
11}
12
13impl LengthSpec {
14    pub const fn new(serial: Option<u64>, parallel: Option<u64>) -> Self {
15        Self { serial, parallel }
16    }
17
18    pub const fn new_serial(serial: u64) -> Self {
19        Self::new(Some(serial), None)
20    }
21
22    pub const fn new_parallel(parallel: u64) -> Self {
23        Self::new(None, Some(parallel))
24    }
25
26    /// Gets the serial value.
27    pub const fn serial(&self) -> Option<u64> {
28        self.serial
29    }
30
31    /// Gets the parallel value.
32    pub const fn parallel(&self) -> Option<u64> {
33        self.parallel
34    }
35}