pub enum ScalarKind {
String,
Integer,
Number,
Boolean,
Date,
Time,
Datetime,
}Expand description
One of the seven predefined value kinds a Scalar can hold (spec §2.2).
Variants§
String
The string scalar kind (UTF-8 character string, spec §2.2).
Integer
The integer scalar kind (arbitrary-precision integer, spec §2.2).
Number
The number scalar kind (IEEE 754 double precision float or integer, spec §2.2).
Boolean
The boolean scalar kind (true or false, spec §2.2).
Date
The date scalar kind (ISO 8601 calendar date YYYY-MM-DD, spec §2.2).
Time
The time scalar kind (ISO 8601 clock time hh:mm:ss, spec §2.2).
Datetime
The datetime scalar kind (ISO 8601 combined date-time, spec §2.2).
Implementations§
Source§impl ScalarKind
impl ScalarKind
Sourcepub const ALL: [ScalarKind; 7]
pub const ALL: [ScalarKind; 7]
All seven kinds, in the order the Python reference declares them.
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Return the canonical OSD name of this scalar kind ("string", "integer", etc., spec §2.2).
Sourcepub fn parse(name: &str) -> Result<ScalarKind, SchemaError>
pub fn parse(name: &str) -> Result<ScalarKind, SchemaError>
Parse a scalar kind name, as it would appear in schema text ("date"
etc). Mirrors Scalar.__init__’s SCALAR_NAMES check.
Trait Implementations§
Source§impl Clone for ScalarKind
impl Clone for ScalarKind
Source§fn clone(&self) -> ScalarKind
fn clone(&self) -> ScalarKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScalarKind
Source§impl Debug for ScalarKind
impl Debug for ScalarKind
impl Eq for ScalarKind
Source§impl Hash for ScalarKind
impl Hash for ScalarKind
Source§impl PartialEq for ScalarKind
impl PartialEq for ScalarKind
Source§fn eq(&self, other: &ScalarKind) -> bool
fn eq(&self, other: &ScalarKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ScalarKind
Auto Trait Implementations§
impl Freeze for ScalarKind
impl RefUnwindSafe for ScalarKind
impl Send for ScalarKind
impl Sync for ScalarKind
impl Unpin for ScalarKind
impl UnsafeUnpin for ScalarKind
impl UnwindSafe for ScalarKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.