Struct hdbconnect_impl::time::HanaTime
source · pub struct HanaTime(pub Time);Expand description
Wraps a time::Time, helps with serializing from and deserializing into time::Time.
Example for serialization
use hdbconnect::ToHana;
use time::{macros::time,Time};
let ts: Time = time!(02:02:02.200000000);
let response = connection.prepare_and_execute(stmt, &(ts.to_hana())).unwrap();Example for deserialization
Deserialize into HanaTime,
then use deref() or to_inner() to access the contained Time.
use hdbconnect::time::HanaTime;
let times: Vec<HanaTime> = connection.query(the_query).unwrap().try_into().unwrap();
let hour = (*times[0]).hour();Tuple Fields§
§0: TimeImplementations§
Methods from Deref<Target = Time>§
Trait Implementations§
source§impl<'de> Deserialize<'de> for HanaTime
impl<'de> Deserialize<'de> for HanaTime
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for HanaTime
impl Send for HanaTime
impl Sync for HanaTime
impl Unpin for HanaTime
impl UnwindSafe for HanaTime
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