Struct gstreamer::DateTime [−][src]
pub struct DateTime(_);
Struct to store date, time and timezone information altogether.
crate::DateTime is refcounted and immutable.
Date information is handled using the proleptic Gregorian calendar.
Provides basic creation functions and accessor functions to its fields.
Implementations
impl DateTime[src]
impl DateTime[src]pub fn from_g_date_time(dt: &DateTime) -> DateTime[src]
pub fn from_iso8601_string(string: &str) -> Result<DateTime, BoolError>[src]
pub fn from_unix_epoch_local_time(secs: i64) -> Result<DateTime, BoolError>[src]
pub fn from_unix_epoch_local_time_usecs(
usecs: i64
) -> Result<DateTime, BoolError>[src]
usecs: i64
) -> Result<DateTime, BoolError>
v1_18 only.pub fn from_unix_epoch_utc(secs: i64) -> Result<DateTime, BoolError>[src]
pub fn from_unix_epoch_utc_usecs(usecs: i64) -> Result<DateTime, BoolError>[src]
v1_18 only.pub fn new_now_local_time() -> DateTime[src]
pub fn new_now_local_time() -> DateTime[src]Creates a new crate::DateTime representing the current date and time.
Free-function: gst_date_time_unref
Returns
the newly created crate::DateTime which should
be freed with [Self::unref()].
pub fn new_now_utc() -> DateTime[src]
pub fn new_now_utc() -> DateTime[src]Creates a new crate::DateTime that represents the current instant at Universal
coordinated time.
Free-function: gst_date_time_unref
Returns
the newly created crate::DateTime which should
be freed with [Self::unref()].
pub fn year(&self) -> i32[src]
pub fn to_g_date_time(&self) -> Result<DateTime, BoolError>[src]
pub fn to_g_date_time(&self) -> Result<DateTime, BoolError>[src]Creates a new crate::glib::DateTime from a fully defined crate::DateTime object.
Free-function: g_date_time_unref
Returns
a newly created crate::glib::DateTime, or
None on error
pub fn to_iso8601_string(&self) -> Result<GString, BoolError>[src]
pub fn to_iso8601_string(&self) -> Result<GString, BoolError>[src]Create a minimal string compatible with ISO-8601. Possible output formats are (for example): 2012, 2012-06, 2012-06-23, 2012-06-23T23:30Z, 2012-06-23T23:30+0100, 2012-06-23T23:30:59Z, 2012-06-23T23:30:59+0100
Returns
a newly allocated string formatted according
to ISO 8601 and only including the datetime fields that are
valid, or None in case there was an error. The string should
be freed with g_free().
impl DateTime[src]
impl DateTime[src]pub fn new<TZ: Into<Option<f32>>, Y: Into<i32>, MO: Into<Option<i32>>, D: Into<Option<i32>>, H: Into<Option<i32>>, MI: Into<Option<i32>>, S: Into<Option<f64>>>(
tzoffset: TZ,
year: Y,
month: MO,
day: D,
hour: H,
minute: MI,
seconds: S
) -> Result<DateTime, BoolError>[src]
pub fn new<TZ: Into<Option<f32>>, Y: Into<i32>, MO: Into<Option<i32>>, D: Into<Option<i32>>, H: Into<Option<i32>>, MI: Into<Option<i32>>, S: Into<Option<f64>>>(
tzoffset: TZ,
year: Y,
month: MO,
day: D,
hour: H,
minute: MI,
seconds: S
) -> Result<DateTime, BoolError>[src]Creates a new crate::DateTime using the date and times in the gregorian calendar
in the supplied timezone.
year should be from 1 to 9999, month should be from 1 to 12, day from
1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.
Note that tzoffset is a float and was chosen so for being able to handle
some fractional timezones, while it still keeps the readability of
representing it in hours for most timezones.
If value is -1 then all over value will be ignored. For example
if month == -1, then crate::DateTime will created only for year. If
day == -1, then crate::DateTime will created for year and month and
so on.
Free-function: gst_date_time_unref
tzoffset
Offset from UTC in hours.
year
the gregorian year
month
the gregorian month
day
the day of the gregorian month
hour
the hour of the day
minute
the minute of the hour
seconds
the second of the minute
Returns
the newly created crate::DateTime
pub fn new_local_time<Y: Into<i32>, MO: Into<Option<i32>>, D: Into<Option<i32>>, H: Into<Option<i32>>, MI: Into<Option<i32>>, S: Into<Option<f64>>>(
year: Y,
month: MO,
day: D,
hour: H,
minute: MI,
seconds: S
) -> Result<DateTime, BoolError>[src]
pub fn new_local_time<Y: Into<i32>, MO: Into<Option<i32>>, D: Into<Option<i32>>, H: Into<Option<i32>>, MI: Into<Option<i32>>, S: Into<Option<f64>>>(
year: Y,
month: MO,
day: D,
hour: H,
minute: MI,
seconds: S
) -> Result<DateTime, BoolError>[src]Creates a new crate::DateTime using the date and times in the gregorian calendar
in the local timezone.
year should be from 1 to 9999, month should be from 1 to 12, day from
1 to 31, hour from 0 to 23, minutes and seconds from 0 to 59.
If month is -1, then the crate::DateTime created will only contain year,
and all other fields will be considered not set.
If day is -1, then the crate::DateTime created will only contain year and
month and all other fields will be considered not set.
If hour is -1, then the crate::DateTime created will only contain year and
month and day, and the time fields will be considered not set. In this
case minute and seconds should also be -1.
Free-function: gst_date_time_unref
year
the gregorian year
month
the gregorian month, or -1
day
the day of the gregorian month, or -1
hour
the hour of the day, or -1
minute
the minute of the hour, or -1
seconds
the second of the minute, or -1
Returns
the newly created crate::DateTime
pub fn new_y(year: i32) -> Result<DateTime, BoolError>[src]
pub fn new_y(year: i32) -> Result<DateTime, BoolError>[src]Creates a new crate::DateTime using the date and times in the gregorian calendar
in the local timezone.
year should be from 1 to 9999.
Free-function: gst_date_time_unref
year
the gregorian year
Returns
the newly created crate::DateTime
pub fn new_ym(year: i32, month: i32) -> Result<DateTime, BoolError>[src]
pub fn new_ym(year: i32, month: i32) -> Result<DateTime, BoolError>[src]Creates a new crate::DateTime using the date and times in the gregorian calendar
in the local timezone.
year should be from 1 to 9999, month should be from 1 to 12.
If value is -1 then all over value will be ignored. For example
if month == -1, then crate::DateTime will created only for year.
Free-function: gst_date_time_unref
year
the gregorian year
month
the gregorian month
Returns
the newly created crate::DateTime
pub fn new_ymd(year: i32, month: i32, day: i32) -> Result<DateTime, BoolError>[src]
pub fn new_ymd(year: i32, month: i32, day: i32) -> Result<DateTime, BoolError>[src]Creates a new crate::DateTime using the date and times in the gregorian calendar
in the local timezone.
year should be from 1 to 9999, month should be from 1 to 12, day from
1 to 31.
If value is -1 then all over value will be ignored. For example
if month == -1, then crate::DateTime will created only for year. If
day == -1, then crate::DateTime will created for year and month and
so on.
Free-function: gst_date_time_unref
year
the gregorian year
month
the gregorian month
day
the day of the gregorian month
Returns
the newly created crate::DateTime
pub fn day(&self) -> Option<i32>[src]
pub fn hour(&self) -> Option<i32>[src]
pub fn microsecond(&self) -> Option<i32>[src]
pub fn minute(&self) -> Option<i32>[src]
pub fn month(&self) -> Option<i32>[src]
pub fn second(&self) -> Option<i32>[src]
pub fn time_zone_offset(&self) -> Option<f32>[src]
pub fn to_utc(&self) -> Result<DateTime, BoolError>[src]
Trait Implementations
impl<'de> Deserialize<'de> for DateTime[src]
impl<'de> Deserialize<'de> for DateTime[src]fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>[src]Deserialize this value from the given Serde deserializer. Read more
impl PartialOrd<DateTime> for DateTime[src]
impl PartialOrd<DateTime> for DateTime[src]fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl StaticType for DateTime[src]
impl StaticType for DateTime[src]fn static_type() -> Type[src]
fn static_type() -> Type[src]Returns the type identifier of Self.
impl Send for DateTime[src]
impl Sync for DateTime[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized, [src]
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized, [src]pub fn to_send_value(&self) -> SendValue[src]
pub fn to_send_value(&self) -> SendValue[src]Returns a SendValue clone of self.
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>, [src]
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,