1mod argv;
16mod client;
17mod diagnostics;
18mod error;
19pub mod fingerprint;
20mod gate;
21mod git;
22mod git_env;
23mod git_signing;
24mod lines;
25mod output;
26pub mod parser;
27pub(crate) mod tokenizer;
28mod transaction;
29mod types;
30mod validate;
31
32#[cfg(feature = "testing")]
33pub mod testing;
34
35#[cfg(feature = "testing")]
36pub use gate::registry_len;
37
38pub use error::{IoError, IoErrorKind, NbError, ParseErrorKind};
39pub use fingerprint::{Fingerprint, fingerprint as compute_fingerprint};
40pub use git::{derive_git_notebook_name, git_rev_parse};
41pub use git_env::{leaked_git_names, scrub_git_env, scrub_git_env_std};
42pub use parser::{
43 BodyFragments, DocumentKind, NoteDocument, ParseContext, SUPPORTED_DOCUMENT_EXTENSIONS,
44 TagsIter, TagsStrIter, TodoState, parse,
45};
46pub use transaction::Transaction;
47pub use types::{
48 BodyFragment, BoundaryAt, ByteString, CommitOutcome, LineAnchor, LineEdit, LinePosition,
49 LineRef, LineTerminator, NoteLine, NoteLineHit, NoteTarget, Occurrence, OpOutcome,
50 SearchNoteLines, ShowNote, ShowNoteLines,
51};
52
53use serde::Deserialize;
54use std::time::Duration;
55
56#[derive(Clone, Debug)]
61pub struct Config {
62 pub notebook: Option<String>,
64 pub create_notebook: bool,
66 pub allow_top_level_notes: bool,
68 pub disable_git_signing: bool,
70 pub gate_timeout: Duration,
72}
73
74impl Default for Config {
75 fn default() -> Self {
76 Self {
77 notebook: None,
78 create_notebook: true,
79 allow_top_level_notes: false,
80 disable_git_signing: false,
81 gate_timeout: gate::DEFAULT_GATE_TIMEOUT,
82 }
83 }
84}
85
86#[derive(Clone)]
88pub struct NbClient {
89 default_notebook: Option<String>,
91 create_notebook: bool,
93 disable_git_signing: bool,
95 allow_top_level_notes: bool,
97 gate_timeout: Duration,
99}
100
101#[derive(Debug, Clone, Copy, Default, Deserialize, PartialEq, Eq)]
103#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
104#[serde(rename_all = "lowercase")]
105pub enum SearchMode {
106 #[default]
108 Any,
109 All,
111}
112
113#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]
115#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
116#[serde(rename_all = "lowercase")]
117pub enum TaskStatus {
118 Open,
120 Closed,
122}