pub enum TypeSpecification {
Boolean {
help: String,
default: Option<bool>,
},
Scale {
minimum: Option<Decimal>,
maximum: Option<Decimal>,
decimals: Option<u8>,
precision: Option<Decimal>,
units: ScaleUnits,
help: String,
default: Option<(Decimal, String)>,
},
Number {
minimum: Option<Decimal>,
maximum: Option<Decimal>,
decimals: Option<u8>,
precision: Option<Decimal>,
help: String,
default: Option<Decimal>,
},
Ratio {
minimum: Option<Decimal>,
maximum: Option<Decimal>,
decimals: Option<u8>,
units: RatioUnits,
help: String,
default: Option<Decimal>,
},
Text {
minimum: Option<usize>,
maximum: Option<usize>,
length: Option<usize>,
options: Vec<String>,
help: String,
default: Option<String>,
},
Date {
minimum: Option<DateTimeValue>,
maximum: Option<DateTimeValue>,
help: String,
default: Option<DateTimeValue>,
},
Time {
minimum: Option<TimeValue>,
maximum: Option<TimeValue>,
help: String,
default: Option<TimeValue>,
},
Duration {
help: String,
default: Option<(Decimal, DurationUnit)>,
},
Veto {
message: Option<String>,
},
Error,
}Variants§
Boolean
Scale
Fields
§
units: ScaleUnitsNumber
Fields
Ratio
Fields
§
units: RatioUnitsText
Fields
Date
Time
Fields
Duration
Veto
Error
Sentinel type used during type inference to represent “type could not be determined.” This propagates through expressions without generating cascading errors. It must never appear in a successfully validated graph or execution plan.
Implementations§
Source§impl TypeSpecification
impl TypeSpecification
pub fn boolean() -> Self
pub fn scale() -> Self
pub fn number() -> Self
pub fn ratio() -> Self
pub fn text() -> Self
pub fn date() -> Self
pub fn time() -> Self
pub fn duration() -> Self
pub fn veto() -> Self
pub fn apply_constraint( self, command: &str, args: &[CommandArg], ) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for TypeSpecification
impl Clone for TypeSpecification
Source§fn clone(&self) -> TypeSpecification
fn clone(&self) -> TypeSpecification
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 TypeSpecification
impl Debug for TypeSpecification
Source§impl<'de> Deserialize<'de> for TypeSpecification
impl<'de> Deserialize<'de> for TypeSpecification
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 Hash for TypeSpecification
impl Hash for TypeSpecification
Source§impl PartialEq for TypeSpecification
impl PartialEq for TypeSpecification
Source§impl Serialize for TypeSpecification
impl Serialize for TypeSpecification
impl Eq for TypeSpecification
impl StructuralPartialEq for TypeSpecification
Auto Trait Implementations§
impl Freeze for TypeSpecification
impl RefUnwindSafe for TypeSpecification
impl Send for TypeSpecification
impl Sync for TypeSpecification
impl Unpin for TypeSpecification
impl UnsafeUnpin for TypeSpecification
impl UnwindSafe for TypeSpecification
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more