Struct fire_postgres::time::DateTime
source · pub struct DateTime(/* private fields */);
Expand description
A DateTime in the utc timezone
Implementations§
source§impl DateTime
impl DateTime
pub fn new(secs: i64, ns: u32) -> DateTime
pub fn now() -> DateTime
pub fn from_std(time: SystemTime) -> DateTime
pub fn from_secs(secs: i64) -> DateTime
pub fn from_ms(ms: u64) -> DateTime
pub fn inner(&self) -> &DateTime<Utc>
pub fn inner_mut(&mut self) -> &mut DateTime<Utc>
pub fn into_inner(self) -> DateTime<Utc>
pub fn to_microsecs_since_2000(&self) -> i64
pub fn from_microsecs_since_2000(secs: i64) -> DateTime
pub fn to_iso8601(&self) -> String
pub fn to_date(&self) -> Date
pub fn parse_from_iso8601(s: &str) -> Result<DateTime, ParseError>
Trait Implementations§
source§impl ColumnType for DateTime
impl ColumnType for DateTime
fn column_kind() -> ColumnKind
source§impl<'a> FromSql<'a> for DateTime
impl<'a> FromSql<'a> for DateTime
source§fn from_sql(
_ty: &Type,
raw: &'a [u8]
) -> Result<DateTime, Box<dyn Error + Sync + Send>>
fn from_sql( _ty: &Type, raw: &'a [u8] ) -> Result<DateTime, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type
in its binary format. Read moresource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type
.source§impl Ord for DateTime
impl Ord for DateTime
source§impl PartialEq for DateTime
impl PartialEq for DateTime
source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToSql for DateTime
impl ToSql for DateTime
source§fn to_sql(
&self,
_ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql( &self, _ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Converts the value of
self
into the binary format of the specified
Postgres Type
, appending it to out
. Read moresource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be converted to the specified
Postgres
Type
.source§fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
An adaptor method used internally by Rust-Postgres. Read more
source§fn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
impl Copy for DateTime
impl Eq for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
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> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
source§fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to
self
as a ToSql
trait object.