From 1983e9dab7779507e52ede00d7e7683344955150 Mon Sep 17 00:00:00 2001 From: nab138 Date: Mon, 9 Feb 2026 09:33:48 -0500 Subject: [PATCH] Add docs --- isideload/src/sideload/builder.rs | 16 ++++++++++++++++ .../{certificate.rs => cert_identity.rs} | 0 isideload/src/sideload/mod.rs | 2 +- isideload/src/sideload/sideloader.rs | 7 ++++++- 4 files changed, 23 insertions(+), 2 deletions(-) rename isideload/src/sideload/{certificate.rs => cert_identity.rs} (100%) diff --git a/isideload/src/sideload/builder.rs b/isideload/src/sideload/builder.rs index 0f243ea..776e218 100644 --- a/isideload/src/sideload/builder.rs +++ b/isideload/src/sideload/builder.rs @@ -29,6 +29,7 @@ impl Display for TeamSelection { } } +/// Behavior when the maximum number of development certificates is reached pub enum MaxCertsBehavior { /// If the maximum number of certificates is reached, revoke certs until it is possible to create a new certificate Revoke, @@ -59,26 +60,41 @@ impl SideloaderBuilder { } } + /// Set the team selection behavior + /// + /// See [`TeamSelection`] for details. pub fn team_selection(mut self, selection: TeamSelection) -> Self { self.team_selection = Some(selection); self } + /// Set the storage backend for sideloading data + /// + /// An implementation using `keyring` is provided in the `keyring-storage` feature. + /// See [`SideloadingStorage`] for details. + /// + /// If not set, either keyring storage or in memory storage (not persisted across runs) will be used depending on if the `keyring-storage` feature is enabled. pub fn storage(mut self, storage: Box) -> Self { self.storage = Some(storage); self } + /// Set the machine name to use for the development certificate + /// + /// This has no bearing on functionality but can be useful for users to identify where a certificate came from. + /// If not set, a default name of "isideload" will be used. pub fn machine_name(mut self, machine_name: String) -> Self { self.machine_name = Some(machine_name); self } + /// Set the behavior for when the maximum number of development certificates is reached pub fn max_certs_behavior(mut self, behavior: MaxCertsBehavior) -> Self { self.max_certs_behavior = Some(behavior); self } + /// Build the `Sideloader` instance with the provided configuration pub fn build(self) -> Sideloader { Sideloader::new( self.developer_session, diff --git a/isideload/src/sideload/certificate.rs b/isideload/src/sideload/cert_identity.rs similarity index 100% rename from isideload/src/sideload/certificate.rs rename to isideload/src/sideload/cert_identity.rs diff --git a/isideload/src/sideload/mod.rs b/isideload/src/sideload/mod.rs index 2446950..f8f8722 100644 --- a/isideload/src/sideload/mod.rs +++ b/isideload/src/sideload/mod.rs @@ -1,4 +1,4 @@ pub mod builder; -pub mod certificate; +pub mod cert_identity; pub mod sideloader; pub use builder::{SideloaderBuilder, TeamSelection}; diff --git a/isideload/src/sideload/sideloader.rs b/isideload/src/sideload/sideloader.rs index 39bbaed..a164e6e 100644 --- a/isideload/src/sideload/sideloader.rs +++ b/isideload/src/sideload/sideloader.rs @@ -4,7 +4,7 @@ use crate::{ devices::DevicesApi, teams::{DeveloperTeam, TeamsApi}, }, - sideload::{TeamSelection, builder::MaxCertsBehavior, certificate::CertificateIdentity}, + sideload::{TeamSelection, builder::MaxCertsBehavior, cert_identity::CertificateIdentity}, util::{device::IdeviceInfo, storage::SideloadingStorage}, }; @@ -24,6 +24,9 @@ pub struct Sideloader { } impl Sideloader { + /// Construct a new `Sideloader` instance with the provided configuration + /// + /// See [`crate::sideload::SideloaderBuilder`] for more details and a more convenient way to construct a `Sideloader`. pub fn new( dev_session: DeveloperSession, apple_email: String, @@ -42,6 +45,7 @@ impl Sideloader { } } + /// Sign and install an app pub async fn install_app( &mut self, device_provider: &impl IdeviceProvider, @@ -73,6 +77,7 @@ impl Sideloader { Ok(()) } + /// Get the developer team according to the configured team selection behavior pub async fn get_team(&mut self) -> Result { let teams = self.dev_session.list_teams().await?; Ok(match teams.len() {