pub struct DateTime { /* private fields */ }Expand description
A date/time value. This is a wrapper around the chrono type with extra functionality for obtaining ticks in OPC UA measurements, endtimes, epoch etc.
Implementations§
Source§impl DateTime
impl DateTime
Sourcepub fn now_with_offset(offset: TimeDelta) -> DateTime
pub fn now_with_offset(offset: TimeDelta) -> DateTime
Constructs from the current time with an offset
Sourcepub fn endtimes_ticks() -> i64
pub fn endtimes_ticks() -> i64
Returns the maximum tick value, corresponding to the end of time
Sourcepub fn ymd_hms(
year: u16,
month: u16,
day: u16,
hour: u16,
minute: u16,
second: u16,
) -> DateTime
pub fn ymd_hms( year: u16, month: u16, day: u16, hour: u16, minute: u16, second: u16, ) -> DateTime
Constructs from a year, month, day, hour, minute, second
Sourcepub fn ymd_hms_nano(
year: u16,
month: u16,
day: u16,
hour: u16,
minute: u16,
second: u16,
nanos: u32,
) -> DateTime
pub fn ymd_hms_nano( year: u16, month: u16, day: u16, hour: u16, minute: u16, second: u16, nanos: u32, ) -> DateTime
Constructs from a year, month, day, hour, minute, second, nanosecond
Sourcepub fn to_rfc3339(&self) -> String
pub fn to_rfc3339(&self) -> String
Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.
Sourcepub fn parse_from_rfc3339(s: &str) -> Result<DateTime, ParseError>
pub fn parse_from_rfc3339(s: &str) -> Result<DateTime, ParseError>
Parses an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00, then returns a new DateTime
Sourcepub fn checked_ticks(&self) -> i64
pub fn checked_ticks(&self) -> i64
To checked ticks. Function returns 0 or MAX_INT64 if date exceeds valid OPC UA range
Trait Implementations§
Source§impl BinaryDecodable for DateTime
impl BinaryDecodable for DateTime
Source§fn decode<S>(stream: &mut S, ctx: &Context<'_>) -> Result<DateTime, Error>
fn decode<S>(stream: &mut S, ctx: &Context<'_>) -> Result<DateTime, Error>
Decodes an instance from the read stream. The decoding options contains restrictions set by
the server / client on the length of strings, arrays etc. If these limits are exceeded the
implementation should return with a
BadDecodingError as soon as possible.Source§impl BinaryEncodable for DateTime
DateTime encoded as 64-bit signed int
impl BinaryEncodable for DateTime
DateTime encoded as 64-bit signed int
Source§fn byte_len(&self, _ctx: &Context<'_>) -> usize
fn byte_len(&self, _ctx: &Context<'_>) -> usize
Returns the exact byte length of the structure as it would be if
encode were called.
This may be called prior to writing to ensure the correct amount of space is available.Source§fn encode<S>(&self, stream: &mut S, _ctx: &Context<'_>) -> Result<(), Error>
fn encode<S>(&self, stream: &mut S, _ctx: &Context<'_>) -> Result<(), Error>
Encodes the instance to the write stream.
Source§fn override_encoding(&self) -> Option<BuiltInDataEncoding>
fn override_encoding(&self) -> Option<BuiltInDataEncoding>
Override the extension object encoding used for this type.
This only makes sense if the type can only ever be encoded using a single
built-in encoding.
Source§impl IntoVariant for Box<DateTime>
impl IntoVariant for Box<DateTime>
Source§fn into_variant(self) -> Variant
fn into_variant(self) -> Variant
Convert self into a variant.
Source§impl IntoVariant for DateTime
impl IntoVariant for DateTime
Source§fn into_variant(self) -> Variant
fn into_variant(self) -> Variant
Convert self into a variant.
Source§impl JsonDecodable for DateTime
impl JsonDecodable for DateTime
Source§impl JsonEncodable for DateTime
impl JsonEncodable for DateTime
Source§impl Ord for DateTime
impl Ord for DateTime
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
Source§impl TryFromVariant for DateTime
impl TryFromVariant for DateTime
Source§impl UaNullable for DateTime
impl UaNullable for DateTime
Source§fn is_ua_null(&self) -> bool
fn is_ua_null(&self) -> bool
Return true if this value is null, meaning it can be left out when
being encoded in JSON and XML encodings.
Source§impl VariantType for DateTime
impl VariantType for DateTime
Source§fn variant_type_id() -> VariantScalarTypeId
fn variant_type_id() -> VariantScalarTypeId
The variant kind this type will be represented as.
Source§impl XmlDecodable for DateTime
impl XmlDecodable for DateTime
Source§impl XmlEncodable for DateTime
impl XmlEncodable for DateTime
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 UnsafeUnpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> EventField for Twhere
T: IntoVariant + Clone,
impl<T> EventField for Twhere
T: IntoVariant + Clone,
Source§fn get_value(
&self,
attribute_id: AttributeId,
index_range: &NumericRange,
remaining_path: &[QualifiedName],
) -> Variant
fn get_value( &self, attribute_id: AttributeId, index_range: &NumericRange, remaining_path: &[QualifiedName], ) -> Variant
Get the variant representation of this field, using the given index range. Read more