Struct optee_utee::time::Time [−][src]
pub struct Time {
pub seconds: u32,
pub millis: u32,
}
Expand description
A millisecond resolution structure for saving the time.
Fields
seconds: u32
The field for the seconds.
millis: u32
The field for the milliseconds within this second.
Implementations
Retrieve the current system time. The origin of this system time is arbitrary and implementation-dependent. Different TA instances may even have different system times. The only guarantee is that the system time is not reset or rolled back during the life of a given TA instance, so it can be used to compute time differences and operation deadlines.
Example
let mut time = Time::new();
time.system_time()?;
Panics
- If the Implementation detects any error.
Wait for the specified number of milliseconds or wait forever if timeout equals
raw::TEE_TIMEOUT_INFINITE
(0xFFFFFFFF). The waiting timer is System Time
.
Parameters
timeout
: The number of milliseconds to wait, orraw::TEE_TIMEOUT_INFINITE
.
Example
Time::wait(1000)?;
Errors
Cancel
: If the wait has been cancelled.
Panics
- If the Implementation detects any error.
Retrieve the persisten time of the Trusted Application. Since the timer is not automatically set, this function should be called after set_ta_time. The time is a real-time source of time and the origin of this time is set individually by each Trusted Application. Also, the time SHALL persist across reboots.
Example
let mut time = Time()?;
time.system_time()?;
time.set_ta_time()?;
time.ta_time()?;
Errors
TimeNotSet
: Time is not set.TimeNeedsReset
: Time needs to be reset.Overflow
: The number of seconds in the TA Persistent Time overflows the range of au32
. The fieldseconds
is still set to the TA Persistent Time truncated to 32 bits.
Panics
- If the Implementation detects any error.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations
pub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
pub fn from(t: T) -> T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
pub fn into(self) -> U
Performs the conversion.