/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/wakelock/lib.rs
29 строк
1 KB
rovertrack
embedder_traits: Move Wakelock trait to Embedder_traits (#44343)
25 апр 2026, 11:07
Не верифицирован
25 апр 2026, 11:07
b768a93
Код
Авторство
О чём код?
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //! Platform abstraction for the Screen Wake Lock API. //! //! Defines [`WakeLockDelegate`], a trait for acquiring and releasing OS-level //! wake locks. Platform-specific implementations will be added in follow-up //! work. For now, [`DefaultWakeLockDelegate`] is the only implementation and //! does nothing. //! //! <https://w3c.github.io/screen-wake-lock/> use std::error::Error; use embedder_traits::{WakeLockDelegate, WakeLockType}; /// A no-op [`WakeLockDelegate`] used when no platform implementation is /// available. All operations succeed silently. pub struct DefaultWakeLockDelegate; impl WakeLockDelegate for DefaultWakeLockDelegate { fn acquire(&self, _type_: WakeLockType) -> Result<(), Box<dyn Error>> { Ok(()) } fn release(&self, _type_: WakeLockType) -> Result<(), Box<dyn Error>> { Ok(()) } }