INNER CODE UNIT · Rust

find

gosub-io/gosub-engine · crates/gosub_config/src/lib.rs:190

    pub fn find(&self, search: &str) -> Vec<String> {
        self.0.read().find(search)
    }

    /// Returns metadata (description, default, constraint) for the given key.
    #[must_use]
    pub fn get_info(&self, key: &str) -> Option<SettingInfo> {
        self.0.read().get_info(key)
    }

    /// Subscribes to changes on settings whose key matches `pattern` (a [`WildMatch`] pattern, so
    /// `*`/`?` wildcards work, e.g. `dns.*` or `*`). The callback fires whenever a matching
    /// setting's value actually changes via `set` or `remove`. Returns an id used to unsubscribe.
    pub fn subscribe<F>(&self, pattern: &str, callback: F) -> SubscriptionId
    where
        F: Fn(&str, &Setting) + Send + Sync + 'static,
    {
        self.0.write().subscribe(pattern, callback)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…