pub struct MockRebootService { /* private fields */ }
Implementations§
Source§impl MockRebootService
impl MockRebootService
Sourcepub fn new(
call_hook: Box<dyn Fn(RebootReason) -> AdminRebootResult + Send + Sync>,
) -> Self
pub fn new( call_hook: Box<dyn Fn(RebootReason) -> AdminRebootResult + Send + Sync>, ) -> Self
Creates a new MockRebootService with a given callback to run per call to the service.
call_hook
must return a Result
for each call, which will be sent to
the caller as the result of the reboot call.
Sourcepub async fn run_reboot_service(
self: Arc<Self>,
stream: AdminRequestStream,
) -> Result<(), Error>
pub async fn run_reboot_service( self: Arc<Self>, stream: AdminRequestStream, ) -> Result<(), Error>
Serves only the reboot portion of the fuchsia.hardware.power.statecontrol protocol on the given request stream.
Sourcepub fn spawn_reboot_service(self: Arc<Self>) -> AdminProxy
pub fn spawn_reboot_service(self: Arc<Self>) -> AdminProxy
Spawns and detaches a Fuchsia async Task which serves the reboot portion of the fuchsia.hardware.power.statecontrol protocol, returning a proxy directly.
Auto Trait Implementations§
impl Freeze for MockRebootService
impl !RefUnwindSafe for MockRebootService
impl Send for MockRebootService
impl Sync for MockRebootService
impl Unpin for MockRebootService
impl !UnwindSafe for MockRebootService
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