pub struct TimeDataType {
pub precision: u8,
pub with_timezone: bool,
}Expand description
Time only without date component.
Maps to: TIME (PostgreSQL, SQL Server, Snowflake), not directly supported in
ClickHouse/Databricks.
§Precision
PostgreSQL: 0-6- SQL Server: 0-7
- Snowflake: 0-9
ClickHouse: 0-9
§Example
use razeri_plugin_contract::data_type::TimeDataType;
// Default precision: 6, no timezone
let time = TimeDataType::default();
assert_eq!(time.precision, 6);
assert!(!time.with_timezone);
// Precision 3, with timezone
let tz_time = TimeDataType::with_timezone(3);
assert_eq!(tz_time.precision, 3);
assert!(tz_time.with_timezone);Fields§
§precision: u8Fractional seconds precision (0-7 for SQL Server, 0-6 for PostgreSQL, 0-9 for Snowflake).
with_timezone: boolWhether to include timezone offset.
Maps to: TIME WITH TIME ZONE (PostgreSQL), not supported in SQL Server.
Implementations§
Source§impl TimeDataType
impl TimeDataType
Sourcepub fn new(precision: u8) -> Self
pub fn new(precision: u8) -> Self
Creates a new TimeDataType with the given fractional seconds precision.
§Panics
Panics if precision exceeds 9.
§Example
use razeri_plugin_contract::data_type::TimeDataType;
let time = TimeDataType::new(3);
assert_eq!(time.precision, 3);
assert!(!time.with_timezone);ⓘ
use razeri_plugin_contract::data_type::TimeDataType;
let _ = TimeDataType::new(10); // panics: precision must be 0-9Sourcepub fn with_timezone(precision: u8) -> Self
pub fn with_timezone(precision: u8) -> Self
Trait Implementations§
Source§impl Clone for TimeDataType
impl Clone for TimeDataType
Source§fn clone(&self) -> TimeDataType
fn clone(&self) -> TimeDataType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TimeDataType
impl Debug for TimeDataType
Source§impl Default for TimeDataType
impl Default for TimeDataType
impl Eq for TimeDataType
Source§impl Hash for TimeDataType
impl Hash for TimeDataType
Source§impl PartialEq for TimeDataType
impl PartialEq for TimeDataType
impl StructuralPartialEq for TimeDataType
Auto Trait Implementations§
impl Freeze for TimeDataType
impl RefUnwindSafe for TimeDataType
impl Send for TimeDataType
impl Sync for TimeDataType
impl Unpin for TimeDataType
impl UnsafeUnpin for TimeDataType
impl UnwindSafe for TimeDataType
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