photokit
Safe Rust bindings for Apple's Photos framework on macOS.
Status: v0.3.0 adds the Tier-1
async_apimodule on top of the fully audited Photos.framework surface, with executor-agnostic futures for authorization,performChanges, image requests, and live-photo editing callbacks.
Quick start
use *;
Async API
Enable the async feature to access non-blocking wrappers for Photos.framework completion-handler APIs:
[]
= { = "0.3", = ["async"] }
use AsyncPHPhotoLibrary;
use PHAccessLevel;
# async
All async types implement std::future::Future and are executor-agnostic.
See async_api for the full API surface.
Highlights
PHPhotoLibraryauthorization helpers plus summary/detailed change observers, availability observers, and persistent-change history helpers.PHAsset,PHCollection,PHAssetCollection, andPHCollectionListfetch helpers with typed subtype/source/resource wrappers.PHChangeRequestbuilders for asset, album, folder, and project mutation flows.PHImageManager/PHCachingImageManagerrequest handles for images, image data, live photos, video requests, and caching.PHAssetResourceManagertransfer helpers for reading or writing asset resources.PHContentEditingInput/PHContentEditingOutputplusPHLivePhotoEditingContextfor non-destructive editing workflows.PHCloudIdentifierbatch lookup helpers and richer Photos-specific error metadata.
Coverage audit
See COVERAGE.md for the framework audit, implemented rows, partial rows, and deferred macOS-unavailable or deprecated APIs.
Examples
The crate ships with numbered examples covering every logical area:
01_photokit_smoke02_phasset_fetch03_phasset_collection_fetch04_phcollection_list_fetch05_phphoto_library_authorization06_phimage_manager_requests07_phfetch_result_methods08_phchange_observer09_phcontent_editing_input10_phcontent_editing_output11_phobject_change_details12_phfetch_options_builder13_phasset_creation_request14_phlive_photo15_phcloud_identifier16_async_api(requires--features async)
Run them with:
for; do
name=""
if [; then
else
fi
done
Verification
for; do
name=""
if [; then
else
fi
done
License
Licensed under either of Apache-2.0 or MIT at your option.