pub struct Scalar { /* private fields */ }Expand description
One of the seven predefined value types, optionally nullable.
Implementations§
Source§impl Scalar
impl Scalar
Sourcepub const fn new(kind: ScalarKind, nullable: bool) -> Self
pub const fn new(kind: ScalarKind, nullable: bool) -> Self
Construct a new Scalar with the given ScalarKind and nullability flag (spec §2.2, §3).
Sourcepub fn named(name: &str, nullable: bool) -> Result<Self, SchemaError>
pub fn named(name: &str, nullable: bool) -> Result<Self, SchemaError>
Construct from a scalar kind’s name (as it appears in schema text), mirroring the Python constructor’s runtime name check.
Sourcepub fn kind(&self) -> ScalarKind
pub fn kind(&self) -> ScalarKind
The value kind of this scalar.
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Whether this scalar accepts null values (the ? suffix in OSD syntax).
Trait Implementations§
impl Copy for Scalar
impl Eq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more