The application core for managing Bottles Next Wine and Proton environments.
bottles-core discovers and installs managed components, persists bottles,
executes Windows programs through WineBridge, and provides checkpointed prefix
mutation and snapshots through the default fvs feature.
Disable FVS when only conventional, directly mutable prefixes are needed:
[dependencies]
bottles-core = { version = "0.1", default-features = false }Without fvs, snapshot APIs and Virgo storage are not compiled, and failed or
cancelled addon recipes are not rolled back automatically.
The crate is centered around four types:
Bottlesowns the download service and provides the addon and bottle managers.Addonspublishes live collections of runners and installable addons. Item values are snapshots; query the manager again after a publication.BottleManagerinterns bottles by UUID. ABottleis a shared handle whose current immutableBottleStatecan be read or watched.Operation<T>represents long-running work with progress and cooperative cancellation.
Operations are lazy. Await them, call cancel().await, or spawn them and
explicitly detach the task; dropping an operation abandons it.
Add bottles-core and an async runtime to your application:
[dependencies]
bottles-core = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Open the library, inspect the current bottles, and stop its download service:
use bottles_core::{Bottles, Config};
#[tokio::main]
async fn main() -> Result<(), bottles_core::error::Error> {
let bottles = Bottles::open(Config::default()).await?;
for bottle in bottles.bottles().list() {
let state = bottle.state()?;
println!("{}\t{}", state.id(), state.name());
}
bottles.close().await
}Build the API documentation locally with cargo doc -p bottles-core --open.
Report bugs through the issue tracker.
Licensed under the GNU General Public License, version 3.