pub enum ScalarLit {
Null,
Bool(bool),
Int(i64),
Str(String),
Json(String),
}Expand description
A literal usable as a const value or an enum member.
Variants§
Null
JSON null.
Bool(bool)
JSON true/false.
Int(i64)
A signed 64-bit integer.
Str(String)
A UTF-8 string.
Json(String)
A composite value held as its canonical JSON serialization (minimal whitespace, declared key order); only that one spelling is accepted (see PROVENANCE.md).
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for ScalarLit
impl<'__de, __Context> BorrowDecode<'__de, __Context> for ScalarLit
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
impl Eq for ScalarLit
Source§impl Ord for ScalarLit
impl Ord for ScalarLit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for ScalarLit
impl PartialOrd for ScalarLit
impl StructuralPartialEq for ScalarLit
Auto Trait Implementations§
impl Freeze for ScalarLit
impl RefUnwindSafe for ScalarLit
impl Send for ScalarLit
impl Sync for ScalarLit
impl Unpin for ScalarLit
impl UnsafeUnpin for ScalarLit
impl UnwindSafe for ScalarLit
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