pub mod content;
pub mod props;
pub mod shell;
pub mod shell_v2;
pub mod sync;
use crate::channel::{Connection, drain};
use crate::error::Result;
pub use shell_v2::ShellOutput;
pub use sync::{Entry, Stat, StatDetail, SyncClient, SyncFeatures};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RebootTarget {
System,
Bootloader,
Recovery,
Sideload,
Fastboot,
}
impl RebootTarget {
pub const fn as_str(self) -> &'static str {
match self {
Self::System => "",
Self::Bootloader => "bootloader",
Self::Recovery => "recovery",
Self::Sideload => "sideload",
Self::Fastboot => "fastboot",
}
}
}
pub async fn reboot<C: Connection>(conn: &C, target: RebootTarget) -> Result<()> {
drain(conn.open(&format!("reboot:{}", target.as_str())).await?).await?;
Ok(())
}