pub struct TimeServices { /* private fields */ }
Implementations§
Source§impl TimeServices
impl TimeServices
Sourcepub fn new(clock: Box<dyn InspectableLocalClock>) -> Self
pub fn new(clock: Box<dyn InspectableLocalClock>) -> Self
Create a new time service using the provided clock source. SaveRestore for the clock should be handled externally.
Sourcepub fn get_time(&mut self) -> Result<EFI_TIME, TimeServiceError>
pub fn get_time(&mut self) -> Result<EFI_TIME, TimeServiceError>
Get the LocalClock
time as EFI_TIME
.
The clock implementation should handle any time delta between the host and guest, including timezone and daylight.
Sourcepub fn set_time(&mut self, new_time: EFI_TIME) -> Result<(), TimeServiceError>
pub fn set_time(&mut self, new_time: EFI_TIME) -> Result<(), TimeServiceError>
Set the LocalClock
time from EFI_TIME
.
The timezone and daylight information are saved so they can be retrieved by the guest, but not processed.
Trait Implementations§
Source§impl InspectMut for TimeServices
impl InspectMut for TimeServices
Source§fn inspect_mut(&mut self, req: Request<'_>)
fn inspect_mut(&mut self, req: Request<'_>)
Inspects the object.
Source§impl SaveRestore for TimeServices
impl SaveRestore for TimeServices
Source§type SavedState = SavedState
type SavedState = SavedState
The concrete saved state type.
Source§fn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>
fn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>
Restores the object’s state.
Auto Trait Implementations§
impl Freeze for TimeServices
impl !RefUnwindSafe for TimeServices
impl Send for TimeServices
impl !Sync for TimeServices
impl Unpin for TimeServices
impl !UnwindSafe for TimeServices
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ProtobufSaveRestore for T
impl<T> ProtobufSaveRestore for T
Source§fn restore(&mut self, state: SavedStateBlob) -> Result<(), RestoreError>
fn restore(&mut self, state: SavedStateBlob) -> Result<(), RestoreError>
Restore the object.