pub struct ConfigBuilder { /* private fields */ }Expand description
Editable configuration source consisting of normalized config data and explicit resource-resolution state.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn from_opt_file(config_file: Option<&Path>) -> Result<Self, ConfigError>
Sourcepub fn from_file(config_file: &Path) -> Result<Self, ConfigError>
pub fn from_file(config_file: &Path) -> Result<Self, ConfigError>
Loads config JSON from a file.
The resulting builder contains the deserialized config data, appends the
config’s path field to the resolver if present, and then appends the
parent directory of config_file as an additional filesystem root.
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, ConfigError>
pub fn from_bytes(data: &[u8]) -> Result<Self, ConfigError>
Loads config JSON from raw bytes.
The resulting builder contains the deserialized config data and appends
the config’s path field to the resolver if present.
Sourcepub fn from_embedded() -> Result<Self, ConfigError>
pub fn from_embedded() -> Result<Self, ConfigError>
Loads the bundled default config JSON.
This only loads the embedded JSON contents; embedded resources
themselves are not enabled unless push_embedded() is called.
pub fn empty() -> Self
pub fn system_dict(self, dict: impl Into<PathBuf>) -> Self
pub fn user_dict(self, dict: impl Into<PathBuf>) -> Self
pub fn character_definition_file(self, path: impl Into<PathBuf>) -> Self
pub fn projection(self, projection: SurfaceProjection) -> Self
pub fn with_resolver(self, resolver: PathResolver) -> Self
pub fn append_resolver(self, other: PathResolver) -> Self
pub fn prepend_resolver(self, other: PathResolver) -> Self
pub fn push_resolver_root(self, path: impl Into<PathBuf>) -> Self
pub fn prepend_resolver_root(self, path: impl Into<PathBuf>) -> Self
pub fn push_embedded(self) -> Self
pub fn fallback_data(self, other: &ConfigBuilder) -> ConfigBuilder
pub fn raw_config(&self) -> &RawConfig
pub fn into_raw_config(self) -> RawConfig
pub fn build(self) -> Config
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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