docs.rs failed to build defaults-rs-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
defaults-rs
Near drop-in replacement for the macOS defaults
CLI with API bindings for Rust
Table of Contents
Key Features
- CLI (
drs
): Use it as a direct replacement fordefaults
without hassle. - Async Rust API: Read, write, delete, rename, import/export, and inspect preferences from Rust code.
- Supports: User and global domains, all plist value types (int, float, bool, string, arrays, dictionaries).
- Familiar Style: Pretty-prints plist data close to the original
defaults
format. - Binary & XML Plist: Handles both binary and XML plist files transparently.
- Extensible: Designed for easy addition of new commands and value types.
Installation
Using brew
:
Using cargo
:
Manual Build & Install
CLI Usage
The CLI command is drs
. It closely mimics the original defaults
tool.
Examples
Read a key
Write a key
# or
Delete a key
Read the whole domain
List all entries in all domains containing word
View all domains
Use the global domain
Read the type of a key
Rename a key
Import/Export a domain
Rust API
To access the developer-side API for defaults-rs
, run the following command and add it to your Cargo project:
Please refer to the API reference for more information about all the available functions.
Example
use ;
async
For writing domains in batches, you can use the batch-write function:
use ;
async
License
This project has been licensed under the MIT License.