pub struct Config {
pub client_name: String,
pub build_info: 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,
}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.
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: ClientTypeImplementations§
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>,
Auto Trait Implementations§
impl Freeze 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<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