pub struct Config {
pub data_dir: PathBuf,
pub keys_file: PathBuf,
pub metering_log: PathBuf,
pub bind: SocketAddr,
}Expand description
Resolved paths and bind address for one server process.
Fields§
§data_dir: PathBufDirectory where index databases live. One <index_id>.db per index.
keys_file: PathBufFile the bearer keys are read from at startup.
metering_log: PathBufFile metering records are appended to, one JSON object per line.
bind: SocketAddrAddress the HTTP server listens on.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Self, ApiError>
pub fn from_env() -> Result<Self, ApiError>
Reads configuration from the environment, applying documented defaults.
Recognised variables: CODETOPO_DATA_DIR, CODETOPO_KEYS_FILE,
CODETOPO_METERING_LOG, CODETOPO_BIND. An empty value is treated as
unset so CODETOPO_BIND= behaves like an absent variable.
Sourcepub fn index_db_path(&self, index_id: &str) -> PathBuf
pub fn index_db_path(&self, index_id: &str) -> PathBuf
Database path for one index id.
Trait Implementations§
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
Mutably borrows from an owned value. Read more
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Converts
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> ⓘ
Converts
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