pub struct Config {Show 14 fields
pub client_name: String,
pub build_info: Option<String>,
pub os_version: Option<String>,
pub lb_version: String,
pub lb_commit: Option<String>,
pub writeable_path: String,
pub background_work: bool,
pub logs: bool,
pub stdout_logs: bool,
pub colored_logs: bool,
pub client_type: ClientType,
pub lock_budget: bool,
pub read_only: bool,
pub list_attachments: bool,
}Fields§
§client_name: StringIdentifies the client in startup logs and lockbook-<client_name>.log.
build_info: Option<String>Optional build identity of a client compiled separately from Rust.
os_version: Option<String>§lb_version: String§lb_commit: Option<String>§writeable_path: StringWhere should lockbook store data, including logs?
background_work: boolShould lb do background work like keep search indexes up to date?
logs: boolShould we log at all?
stdout_logs: boolShould logs be printed to stdout?
colored_logs: boolShould logs be colored?
client_type: ClientType§lock_budget: boolShould dev accounts exit when a db lock is held past its budget? Set per platform: a host turns it on where it enforces the frame budget. lb-rs can’t derive it, since ClientType::Ui doesn’t mean the host has a frame budget.
read_only: bool§list_attachments: boolShould listings, recents, pending shares and search include attachments folders and their contents? The apps leave them out; the CLI and the Files app show them. The recipient of an individually shared note never sees its attachments folder listed, whatever this is set to.
Implementations§
Source§impl Config
impl Config
Sourcepub fn cli_config(writeable_path_subfolder: &str) -> Config
pub fn cli_config(writeable_path_subfolder: &str) -> Config
Configures lockbook for CLI use with no stdout logs or background work. writeable_path_subfolder is generally
a hardcoded client name like "cli".
Sourcepub fn ui_config(writeable_path_subfolder: &str) -> Config
pub fn ui_config(writeable_path_subfolder: &str) -> Config
Configures lockbook for UI use with stdout logs and background work. writeable_path_subfolder is generally
a hardcoded client name like "macos".
Sourcepub fn writeable_path(writeable_path_subfolder: &str) -> String
pub fn writeable_path(writeable_path_subfolder: &str) -> String
Produces a full writable path for lockbook to use based on environment variables and platform. Useful for initializing the Config struct.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more