pub struct Options { /* private fields */ }Expand description
Options store for reading configuration values.
Implementations§
Source§impl Options
impl Options
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Load options using fallback chain: SENTRY_OPTIONS_DIR env var, then /etc/sentry-options
if it exists, otherwise sentry-options/.
Expects {dir}/schemas/ and {dir}/values/ subdirectories.
Sourcepub fn from_directory(base_dir: &Path) -> Result<Self>
pub fn from_directory(base_dir: &Path) -> Result<Self>
Load options from a specific directory (useful for testing).
Expects {base_dir}/schemas/ and {base_dir}/values/ subdirectories.
Sourcepub fn from_schemas(schemas: &[(&str, &str)]) -> Result<Self>
pub fn from_schemas(schemas: &[(&str, &str)]) -> Result<Self>
Load options with schemas provided as in-memory JSON strings. Values are loaded from disk using the standard fallback chain.
Sourcepub fn get(&self, namespace: &str, key: &str) -> Result<Value>
pub fn get(&self, namespace: &str, key: &str) -> Result<Value>
Get an option value, returning the schema default if not set.
Auto Trait Implementations§
impl Freeze for Options
impl !RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl !UnwindSafe for Options
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