assure docs can be built without warnings by default.

It's a good way to review import paths and the public API.
This commit is contained in:
Sebastian Thiel 2024-07-12 15:34:45 +02:00
parent 3ef3dbc24f
commit 6fb6201ab9
No known key found for this signature in database
GPG Key ID: 9CB5EE7895E8268B
2 changed files with 6 additions and 9 deletions

View File

@ -12,7 +12,7 @@ static mut GLOBAL_ASKPASS_BROKER: Option<AskpassBroker> = None;
///
/// # Safety
/// This function **must** be called **at least once**, from only one thread at a time,
/// before any other function from this module is called. **Calls to [`get`] before [`init`] will panic.**
/// before any other function from this module is called. **Calls to [`get_broker`] before [`init`] will panic.**
///
/// This function is **NOT** thread safe.
pub unsafe fn init(submit_prompt: impl Fn(PromptEvent<Context>) + Send + Sync + 'static) {

View File

@ -2,19 +2,16 @@
//!
//! ## How to use this
//!
//! Just make sure this [`Error`] type is used for each provided `tauri` command. The rest happens automatically
//! such that:
//! Just make sure this `Error` type is used for each provided `tauri` command. The rest happens automatically
//! such that [context](gitbutler_error::error::Context) is handled correctly.
//!
//! * The frontend shows the root error as string by default…
//! * …or it shows the provided [`Context`](gitbutler_core::error::Context) as controlled by the `core` crate.
//!
//! ### Interfacing with `tauri` using [`Error`]
//! ### Interfacing with `tauri` using `Error`
//!
//! `tauri` serializes backend errors and makes these available as JSON objects to the frontend. The format
//! is an implementation detail, but here it's implemented to turn each [`Error`] into a dict with `code`
//! is an implementation detail, but here it's implemented to turn each `Error` into a dict with `code`
//! and `messsage` fields.
//!
//! The values in these fields are controlled by attaching context, please [see the `core` docs](gitbutler_core::error))
//! The values in these fields are controlled by attaching context, please [see the `error` docs](gitbutler_error::error))
//! on how to do this.
pub(crate) use frontend::Error;