pub enum CastTarget {
Show 16 variants
Boolean,
Smallint,
Integer,
Bigint,
Numeric(Option<NumericTypmod>),
Text,
Varchar(Option<CharLength>),
Bpchar(Option<CharLength>),
Date,
Timestamp(Option<u8>),
TimestampTz(Option<u8>),
Time(Option<u8>),
TimeTz(Option<u8>),
Jsonb,
Uuid,
Interval(IntervalTypmod),
}Expand description
The type a literal or value is cast to, with its modifier.
Variants§
Boolean
boolean.
Smallint
smallint.
Integer
integer.
Bigint
bigint.
Numeric(Option<NumericTypmod>)
numeric, or numeric(p, s) with a modifier.
Text
text.
Varchar(Option<CharLength>)
varchar, or varchar(n) with a length.
Bpchar(Option<CharLength>)
bpchar, or char(n) with a length, where a bare char is char(1).
Date
date.
Timestamp(Option<u8>)
timestamp, or timestamp(p) with a precision, where one above 6 is 6.
TimestampTz(Option<u8>)
timestamptz, or timestamptz(p) with a precision, where one above 6 is 6.
Time(Option<u8>)
time, or time(p) with a precision, where one above 6 is 6.
TimeTz(Option<u8>)
timetz, or timetz(p) with a precision, where one above 6 is 6.
Jsonb
jsonb.
Uuid
uuid.
Interval(IntervalTypmod)
interval, with the fields it keeps and its fractional-second digits as in
interval day to second(3).
Implementations§
Trait Implementations§
Source§impl Clone for CastTarget
impl Clone for CastTarget
impl Copy for CastTarget
Source§impl Debug for CastTarget
impl Debug for CastTarget
impl Eq for CastTarget
Source§impl From<IntegerType> for CastTarget
impl From<IntegerType> for CastTarget
Source§fn from(integer: IntegerType) -> Self
fn from(integer: IntegerType) -> Self
Converts to this type from the input type.
Source§impl Hash for CastTarget
impl Hash for CastTarget
Source§impl PartialEq for CastTarget
impl PartialEq for CastTarget
impl StructuralPartialEq for CastTarget
Source§impl TryFrom<CastTarget> for IntegerType
Refuses a target that is not an integer type, returning it.
impl TryFrom<CastTarget> for IntegerType
Refuses a target that is not an integer type, returning it.
Source§type Error = CastTarget
type Error = CastTarget
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for CastTarget
impl Freeze for CastTarget
impl Move for CastTarget
impl RefUnwindSafe for CastTarget
impl Send for CastTarget
impl Sync for CastTarget
impl Unpin for CastTarget
impl UnsafeUnpin for CastTarget
impl UnwindSafe for CastTarget
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